Skip to content

Commit

Permalink
vmware_deploy_ovf: Fix the issue that the name variable referenced er…
Browse files Browse the repository at this point in the history
…ror occurs (#499)

vmware_deploy_ovf: Fix the issue that the name variable referenced error occurs

Reviewed-by: https://github.com/apps/ansible-zuul
  • Loading branch information
sky-joker authored Nov 14, 2020
1 parent 46f83d3 commit 619a5b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/499-vmware_deploy_ovf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- vmware_deploy_ovf - fixed an UnboundLocalError for variable 'name' in check mode (https://github.com/ansible-collections/community.vmware/pull/499).
1 change: 1 addition & 0 deletions plugins/modules/vmware_deploy_ovf.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ def get_lease(self):
for warning in getattr(self.import_spec, 'warning', []):
self.module.warn('Problem validating OVF import spec: %s' % to_native(warning.msg))

name = self.params.get('name')
if not self.params['allow_duplicates']:
name = self.import_spec.importSpec.configSpec.name
match = find_vm_by_name(self.content, name, folder=folder)
Expand Down

0 comments on commit 619a5b2

Please sign in to comment.