Commit 3efa9051 authored by Iustin Pop's avatar Iustin Pop
Browse files

Convert blockdev_getmirrorstatus rpc to new style

Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent a9fe7e8f
......@@ -1374,9 +1374,9 @@ def BlockdevGetmirrorstatus(disks):
for dsk in disks:
rbd = _RecursiveFindBD(dsk)
if rbd is None:
raise errors.BlockDeviceError("Can't find device %s" % str(dsk))
_Fail("Can't find device %s", dsk)
return stats
return True, stats
def _RecursiveFindBD(disk):
......@@ -1688,15 +1688,16 @@ def _WaitForSync(lu, instance, oneshot=False, unlock=False):
done = True
cumul_degraded = False
rstats = lu.rpc.call_blockdev_getmirrorstatus(node, instance.disks)
if rstats.failed or not
lu.LogWarning("Can't get any data from node %s", node)
msg = rstats.RemoteFailMsg()
if msg:
lu.LogWarning("Can't get any data from node %s: %s", node, msg)
retries += 1
if retries >= 10:
raise errors.RemoteError("Can't contact node %s for mirror data,"
" aborting." % node)
rstats =
rstats = rstats.payload
retries = 0
for i, mstat in enumerate(rstats):
if mstat is None:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment