Commit fe89794e authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

RpcResult: Fix cases where “failed” wouldn't be set to True

This broke “gnt-instance replace-disks --auto” when the instance
is down.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarOlivier Tharan <>
parent ea205dbc
......@@ -1544,7 +1544,6 @@ class LURepairDiskSizes(NoHooksLU):
REQ_BGL = False
def ExpandNames(self):
if not isinstance(self.op.instances, list):
raise errors.OpPrereqError("Invalid argument type 'instances'")
......@@ -1602,7 +1601,7 @@ class LURepairDiskSizes(NoHooksLU):
changed = []
for node, dskl in per_node_disks.items():
result = self.rpc.call_blockdev_getsizes(node, [v[2] for v in dskl])
if result.failed:
if result.failed or result.fail_msg:
self.LogWarning("Failure in blockdev_getsizes call to node"
" %s, ignoring", node)
......@@ -111,12 +111,15 @@ class RpcResult(object):
else: = data
if not isinstance(, (tuple, list)):
self.failed = True
self.fail_msg = ("RPC layer error: invalid result type (%s)" %
elif len(data) != 2:
self.failed = True
self.fail_msg = ("RPC layer error: invalid result length (%d), "
"expected 2" % len(
elif not[0]:
self.failed = True
self.fail_msg = self._EnsureErr([1])
# finally success
......@@ -810,7 +813,7 @@ class RpcRunner(object):
result = self._SingleNodeCall(node, "blockdev_getmirrorstatus",
[dsk.ToDict() for dsk in disks])
if not result.failed:
if not (result.failed or result.fail_msg):
result.payload = [objects.BlockDevStatus.FromDict(i)
for i in result.payload]
return result
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