From b3271e8c9844e2b620ee80ca6e73889d18b9b91f Mon Sep 17 00:00:00 2001 From: "Ashby, Jason (IMS)" Date: Wed, 23 Sep 2015 08:14:52 -0400 Subject: [PATCH] #12 fixed waitfortasks hang issue --- ezmomi/cli.py | 2 -- ezmomi/ezmomi.py | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ezmomi/cli.py b/ezmomi/cli.py index 4f8a53c..43e124e 100644 --- a/ezmomi/cli.py +++ b/ezmomi/cli.py @@ -12,8 +12,6 @@ def cli(): ) subparsers = parser.add_subparsers(help='Command', dest='mode') - from pprint import pprint - # set up each command section add_params(subparsers) diff --git a/ezmomi/ezmomi.py b/ezmomi/ezmomi.py index e19ea78..6d6cf99 100644 --- a/ezmomi/ezmomi.py +++ b/ezmomi/ezmomi.py @@ -576,7 +576,7 @@ def get_host_system_failfast(self, name, verbose=False, host_system_term='HS'): sys.exit(1) if True == verbose: - print("Found HostSystem: {0} Name: {1}", hs, hs.name) + print "Found HostSystem: {0} Name: {1}" % (hs, hs.name) return hs @@ -600,7 +600,7 @@ def get_vm_failfast(self, name, verbose=False, vm_term='VM'): sys.exit(1) if True == verbose: - print("Found VirtualMachine: {0} Name: {1}", vm, vm.name) + print "Found VirtualMachine: %s Name: %s" % (vm, vm.name) return vm @@ -642,8 +642,9 @@ def WaitForTasks(self, tasks): if change.name == 'info': state = change.val.state elif change.name == 'info.state': - if not str(task) in taskList: - continue + state = change.val + else: + continue if state == vim.TaskInfo.State.success: # Remove task from taskList