Check values for vm_id and vm_names instead of keys (#3621)

This commit is contained in:
Fabian von Feilitzsch 2016-12-03 08:47:52 -05:00 committed by Matt Clay
parent 50deb312fe
commit 92a53a7182

View file

@ -280,7 +280,7 @@ def main():
ret = disks_module.remove()
# If VM was passed attach/detach disks to/from the VM:
if 'vm_id' in module.params or 'vm_name' in module.params and state != 'absent':
if module.params.get('vm_id') is not None or module.params.get('vm_name') is not None and state != 'absent':
vms_service = connection.system_service().vms_service()
# If `vm_id` isn't specified, find VM by name: