Revision 7ad1af4a lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
2912 | 2912 |
remote_info = self.rpc.call_instance_info(instance.primary_node, |
2913 | 2913 |
instance.name, |
2914 | 2914 |
instance.hypervisor) |
2915 |
remote_info.Raise() |
|
2916 |
if not remote_info.data: |
|
2915 |
msg = remote_info.RemoteFailMsg() |
|
2916 |
if msg: |
|
2917 |
raise errors.OpPrereqError("Error checking node %s: %s" % |
|
2918 |
(instance.primary_node, msg)) |
|
2919 |
if not remote_info.payload: # not running already |
|
2917 | 2920 |
_CheckNodeFreeMemory(self, instance.primary_node, |
2918 | 2921 |
"starting instance %s" % instance.name, |
2919 | 2922 |
bep[constants.BE_MEMORY], instance.hypervisor) |
... | ... | |
3114 | 3117 |
remote_info = self.rpc.call_instance_info(instance.primary_node, |
3115 | 3118 |
instance.name, |
3116 | 3119 |
instance.hypervisor) |
3117 |
remote_info.Raise() |
|
3118 |
if remote_info.data: |
|
3120 |
msg = remote_info.RemoteFailMsg() |
|
3121 |
if msg: |
|
3122 |
raise errors.OpPrereqError("Error checking node %s: %s" % |
|
3123 |
(instance.primary_node, msg)) |
|
3124 |
if remote_info.payload: |
|
3119 | 3125 |
raise errors.OpPrereqError("Instance '%s' is running on the node %s" % |
3120 | 3126 |
(self.op.instance_name, |
3121 | 3127 |
instance.primary_node)) |
... | ... | |
3198 | 3204 |
remote_info = self.rpc.call_instance_info(instance.primary_node, |
3199 | 3205 |
instance.name, |
3200 | 3206 |
instance.hypervisor) |
3201 |
remote_info.Raise() |
|
3202 |
if remote_info.data: |
|
3207 |
msg = remote_info.RemoteFailMsg() |
|
3208 |
if msg: |
|
3209 |
raise errors.OpPrereqError("Error checking node %s: %s" % |
|
3210 |
(instance.primary_node, msg)) |
|
3211 |
if remote_info.payload: |
|
3203 | 3212 |
raise errors.OpPrereqError("Instance '%s' is running on the node %s" % |
3204 | 3213 |
(self.op.instance_name, |
3205 | 3214 |
instance.primary_node)) |
... | ... | |
5807 | 5816 |
remote_info = self.rpc.call_instance_info(instance.primary_node, |
5808 | 5817 |
instance.name, |
5809 | 5818 |
instance.hypervisor) |
5810 |
remote_info.Raise() |
|
5811 |
remote_info = remote_info.data |
|
5819 |
msg = remote_info.RemoteFailMsg() |
|
5820 |
if msg: |
|
5821 |
raise errors.OpExecError("Error checking node %s: %s" % |
|
5822 |
(instance.primary_node, msg)) |
|
5823 |
remote_info = remote_info.payload |
|
5812 | 5824 |
if remote_info and "state" in remote_info: |
5813 | 5825 |
remote_state = "up" |
5814 | 5826 |
else: |
... | ... | |
6099 | 6111 |
if nodeinfo[pnode].failed or not isinstance(nodeinfo[pnode].data, dict): |
6100 | 6112 |
# Assume the primary node is unreachable and go ahead |
6101 | 6113 |
self.warn.append("Can't get info from primary node %s" % pnode) |
6114 |
elif instance_info.RemoteFailMsg(): |
|
6115 |
self.warn.append("Can't get instance runtime information: %s" % |
|
6116 |
instance_info.RemoteFailMsg()) |
|
6102 | 6117 |
else: |
6103 |
if not instance_info.failed and instance_info.data:
|
|
6104 |
current_mem = int(instance_info.data['memory'])
|
|
6118 |
if instance_info.payload:
|
|
6119 |
current_mem = int(instance_info.payload['memory'])
|
|
6105 | 6120 |
else: |
6106 | 6121 |
# Assume instance not running |
6107 | 6122 |
# (there is a slight race condition here, but it's not very probable, |
Also available in: Unified diff