mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-02 23:31:25 -07:00
Provide clear error message after failure (#32928)
This commit is contained in:
parent
2d4c4e09db
commit
e61bcc3438
3 changed files with 71 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue