diff --git a/lib/ansible/modules/extras/cloud/vmware/vmware_vm_shell.py b/lib/ansible/modules/extras/cloud/vmware/vmware_vm_shell.py index a2d5c71098e..da4a7f62217 100644 --- a/lib/ansible/modules/extras/cloud/vmware/vmware_vm_shell.py +++ b/lib/ansible/modules/extras/cloud/vmware/vmware_vm_shell.py @@ -146,11 +146,11 @@ def main(): if not HAS_PYVMOMI: module.fail_json(changed=False, msg='pyvmomi is required for this module') - datacenter_name = p['datacenter'] - cluster_name = p['cluster'] try: p = module.params + datacenter_name = p['datacenter'] + cluster_name = p['cluster'] content = connect_to_api(module) datacenter = None @@ -185,4 +185,3 @@ from ansible.module_utils.basic import * if __name__ == '__main__': main() -