mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Provide clear error message after failure (#32928)
This commit is contained in:
@@ -1580,8 +1580,9 @@ def main():
|
||||
# VM doesn't exist
|
||||
else:
|
||||
if module.params['state'] in ['poweredon', 'poweredoff', 'present', 'restarted', 'suspended']:
|
||||
# Create it ...
|
||||
result = pyv.deploy_vm()
|
||||
if result['failed']:
|
||||
module.fail_json(msg='Failed to create a virtual machine : %s' % result['msg'])
|
||||
|
||||
if result['failed']:
|
||||
module.fail_json(**result)
|
||||
|
||||
Reference in New Issue
Block a user