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>
This commit is contained in:
parent
d73e9a6508
commit
d06d1d4840
1 changed files with 4 additions and 1 deletions
|
@ -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…
Reference in a new issue