Commit b99477f9 by Szabolcs Gelencser

Catch UNKOWN state exceptions of VMs

parent 0fb681e6
......@@ -157,14 +157,17 @@ class Client:
group_name, vm_name.name, expand="instanceView"
)
# get vm power state
vm_power_state = (
status for status in vm.instance_view.statuses
if status.code.startswith("PowerState")
).next().code
if(vm_power_state == "PowerState/running"):
running_virtual_machines.append(vm)
try:
# get vm power state
vm_power_state = (
status for status in vm.instance_view.statuses
if status.code.startswith("PowerState")
).next().code
if(vm_power_state == "PowerState/running"):
running_virtual_machines.append(vm)
except:
pass
return running_virtual_machines
......
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 sign in to comment