mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 08:13:08 +00:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user