Revision 583e3f6f
b/lib/bdev.py | ||
---|---|---|
866 | 866 |
"""Returns the sync status of the device. |
867 | 867 |
|
868 | 868 |
Returns: |
869 |
(sync_percent, estimated_time) |
|
869 |
(sync_percent, estimated_time, is_degraded)
|
|
870 | 870 |
|
871 | 871 |
If sync_percent is None, it means all is ok |
872 | 872 |
If estimated_time is None, it means we can't esimate |
... | ... | |
1444 | 1444 |
"""Returns the sync status of the device. |
1445 | 1445 |
|
1446 | 1446 |
Returns: |
1447 |
(sync_percent, estimated_time) |
|
1447 |
(sync_percent, estimated_time, is_degraded)
|
|
1448 | 1448 |
|
1449 | 1449 |
If sync_percent is None, it means all is ok |
1450 | 1450 |
If estimated_time is None, it means we can't esimate |
... | ... | |
1911 | 1911 |
"""Returns the sync status of the device. |
1912 | 1912 |
|
1913 | 1913 |
Returns: |
1914 |
(sync_percent, estimated_time) |
|
1914 |
(sync_percent, estimated_time, is_degraded)
|
|
1915 | 1915 |
|
1916 | 1916 |
If sync_percent is None, it means all is ok |
1917 | 1917 |
If estimated_time is None, it means we can't esimate |
... | ... | |
1936 | 1936 |
else: |
1937 | 1937 |
sync_percent = None |
1938 | 1938 |
est_time = None |
1939 |
match = re.match("^ *[0-9]+: cs:([^ ]+).*$", line)
|
|
1939 |
match = re.match("^ *\d+: cs:(\w+).*ds:(\w+)/(\w+).*$", line)
|
|
1940 | 1940 |
if not match: |
1941 | 1941 |
raise errors.BlockDeviceError("Can't find my data in /proc (minor %d)" % |
1942 | 1942 |
self.minor) |
1943 | 1943 |
client_state = match.group(1) |
1944 |
is_degraded = client_state != "Connected" |
|
1944 |
local_disk_state = match.group(2) |
|
1945 |
is_degraded = (client_state != "Connected" or |
|
1946 |
local_disk_state != "UpToDate") |
|
1945 | 1947 |
return sync_percent, est_time, is_degraded |
1946 | 1948 |
|
1947 | 1949 |
def GetStatus(self): |
Also available in: Unified diff