Revision 0959c824 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
2287 | 2287 |
result.append(("master_candidate", str(self.op.master_candidate))) |
2288 | 2288 |
if self.op.master_candidate == False: |
2289 | 2289 |
rrc = self.rpc.call_node_demote_from_mc(node.name) |
2290 |
if (rrc.failed or not isinstance(rrc.data, (tuple, list)) |
|
2291 |
or len(rrc.data) != 2): |
|
2292 |
self.LogWarning("Node rpc error: %s" % rrc.error) |
|
2293 |
elif not rrc.data[0]: |
|
2294 |
self.LogWarning("Node failed to demote itself: %s" % rrc.data[1]) |
|
2290 |
msg = rrc.RemoteFailMsg() |
|
2291 |
if msg: |
|
2292 |
self.LogWarning("Node failed to demote itself: %s" % msg) |
|
2295 | 2293 |
|
2296 | 2294 |
# this will trigger configuration file update, if needed |
2297 | 2295 |
self.cfg.Update(node) |
... | ... | |
3535 | 3533 |
if msg: |
3536 | 3534 |
raise errors.OpExecError("Cannot resync disks on node %s: %s" % |
3537 | 3535 |
(node, msg)) |
3538 |
node_done, node_percent = nres.data[1]
|
|
3536 |
node_done, node_percent = nres.payload
|
|
3539 | 3537 |
all_done = all_done and node_done |
3540 | 3538 |
if node_percent is not None: |
3541 | 3539 |
min_percent = min(min_percent, node_percent) |
... | ... | |
3721 | 3719 |
msg = result.RemoteFailMsg() |
3722 | 3720 |
if msg: |
3723 | 3721 |
log_err = ("Failed fetching source migration information from %s: %s" % |
3724 |
(source_node, msg))
|
|
3722 |
(source_node, msg)) |
|
3725 | 3723 |
logging.error(log_err) |
3726 | 3724 |
raise errors.OpExecError(log_err) |
3727 | 3725 |
|
3728 |
self.migration_info = migration_info = result.data[1]
|
|
3726 |
self.migration_info = migration_info = result.payload
|
|
3729 | 3727 |
|
3730 | 3728 |
# Then switch the disks to master/master mode |
3731 | 3729 |
self._EnsureSecondary(target_node) |
... | ... | |
3877 | 3875 |
" node %s for instance %s: %s" % |
3878 | 3876 |
(device, node, instance.name, msg)) |
3879 | 3877 |
if device.physical_id is None: |
3880 |
device.physical_id = result.data[1]
|
|
3878 |
device.physical_id = result.payload
|
|
3881 | 3879 |
|
3882 | 3880 |
|
3883 | 3881 |
def _GenerateUniqueNames(lu, exts): |
... | ... | |
4108 | 4106 |
info = hvinfo[node] |
4109 | 4107 |
if info.offline: |
4110 | 4108 |
continue |
4111 |
info.Raise() |
|
4112 |
if not info.data or not isinstance(info.data, (tuple, list)): |
|
4113 |
raise errors.OpPrereqError("Cannot get current information" |
|
4114 |
" from node '%s' (%s)" % (node, info.data)) |
|
4115 |
if not info.data[0]: |
|
4109 |
msg = info.RemoteFailMsg() |
|
4110 |
if msg: |
|
4116 | 4111 |
raise errors.OpPrereqError("Hypervisor parameter validation failed:" |
4117 |
" %s" % info.data[1])
|
|
4112 |
" %s" % msg)
|
|
4118 | 4113 |
|
4119 | 4114 |
|
4120 | 4115 |
class LUCreateInstance(LogicalUnit): |
... | ... | |
5346 | 5341 |
for node in instance.all_nodes: |
5347 | 5342 |
self.cfg.SetDiskID(disk, node) |
5348 | 5343 |
result = self.rpc.call_blockdev_grow(node, disk, self.op.amount) |
5349 |
result.Raise() |
|
5350 |
if (not result.data or not isinstance(result.data, (list, tuple)) or |
|
5351 |
len(result.data) != 2): |
|
5352 |
raise errors.OpExecError("Grow request failed to node %s" % node) |
|
5353 |
elif not result.data[0]: |
|
5344 |
msg = result.RemoteFailMsg() |
|
5345 |
if msg: |
|
5354 | 5346 |
raise errors.OpExecError("Grow request failed to node %s: %s" % |
5355 |
(node, result.data[1]))
|
|
5347 |
(node, msg))
|
|
5356 | 5348 |
disk.RecordGrow(self.op.amount) |
5357 | 5349 |
self.cfg.Update(instance) |
5358 | 5350 |
if self.op.wait_for_sync: |
Also available in: Unified diff