From 1f8c5905b327eeeb53e429b13f0c2262fd317240 Mon Sep 17 00:00:00 2001 From: mrmagooey Date: Tue, 18 Sep 2018 21:23:17 +1000 Subject: [PATCH] VMware: fix return to return a tuple instead of a bool (#45764) fixes "'bool' object is not iterable" exception when `res` is falsey --- lib/ansible/modules/cloud/vmware/vmware_vm_shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_vm_shell.py b/lib/ansible/modules/cloud/vmware/vmware_vm_shell.py index 679ce0c629..89368a3add 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_vm_shell.py +++ b/lib/ansible/modules/cloud/vmware/vmware_vm_shell.py @@ -291,7 +291,7 @@ class VMwareShellManager(PyVmomi): def process_exists_in_guest(self, vm, pid, creds): res = self.pm.ListProcessesInGuest(vm, creds, pids=[pid]) if not res: - return False + return False, '' res = res[0] if res.exitCode is None: return True, ''