VMware: Check return of FindByInventoryPath (#55282)
Check return value of FindByInventoryPath API which is used for finding desired folder to deploy OVF. Fixes: #54823 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
f247c21d23
commit
ffce456de9
2 changed files with 4 additions and 0 deletions
2
changelogs/fragments/54823-vmware_deploy_ovf-folder.yml
Normal file
2
changelogs/fragments/54823-vmware_deploy_ovf-folder.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- Check return value of FindByInventoryPath API used for finding folder value (https://github.com/ansible/ansible/issues/54823).
|
|
@ -370,6 +370,8 @@ class VMwareDeployOvf:
|
|||
|
||||
if self.params['folder']:
|
||||
folder = self.si.searchIndex.FindByInventoryPath(self.params['folder'])
|
||||
if not folder:
|
||||
self.module.fail_json(msg="Unable to find the specified folder %(folder)s" % self.params)
|
||||
else:
|
||||
folder = datacenter.vmFolder
|
||||
|
||||
|
|
Loading…
Reference in a new issue