Skip to content

Commit

Permalink
pyvbox.py vm command: Handle error in displaying a VM and keep going.
Browse files Browse the repository at this point in the history
  • Loading branch information
von committed Apr 15, 2012
1 parent 00f871e commit 2229512
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions utils/pyvbox.py
Expand Up @@ -524,11 +524,17 @@ def invoke(cls, args):
vms = VirtualMachine.getAll()
verboseMsg("Registered VMs:")
for vm in vms:
print "\t%s" % vm
try:
print "\t%s" % vm
except Exception as e:
errorMsg("Could not display VM: %s" % str(e))
else:
for vmName in args:
vm = VirtualMachine.find(vmName)
print_vm(vm)
try:
vm = VirtualMachine.find(vmName)
print_vm(vm)
except Exception as e:
errorMsg("Could not display information about VM \"%s\": %s" % (vmName, str(e)))

Command.register_command("vm", VMCommand)

Expand Down

0 comments on commit 2229512

Please sign in to comment.