VMware: minor fix for vmware_deploy_ovf (#44299)

* Check value of ovf path
* Assign variable before using

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/44376/head
Abhijeet Kasurde 6 years ago committed by GitHub
parent d73e9a6508
commit d06d1d4840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -415,6 +415,9 @@ class VMwareDeployOvf:
return urlunparse(url_parts.as_list())
def upload(self):
if self.params['ovf'] is None:
self.module.fail_json(msg="OVF path is required for upload operation.")
ovf_dir = os.path.dirname(self.params['ovf'])
lease, import_spec = self.get_lease()
@ -436,6 +439,7 @@ class VMwareDeployOvf:
msg='Failed to find deviceUrl for file %s' % file_item.path
)
vmdk_tarinfo = None
if self.tar:
vmdk = self.tar
try:
@ -458,7 +462,6 @@ class VMwareDeployOvf:
self.module.fail_json(
msg='Failed to find VMDK file at %s' % vmdk
)
vmdk_tarinfo = None
uploaders.append(
VMDKUploader(

Loading…
Cancel
Save