Skip to content

Commit

Permalink
vmware_guest: change fail to fail_json function (#1402)
Browse files Browse the repository at this point in the history
vmware_guest: change fail to fail_json function

Signed-off-by: Diane Wang [email protected]
SUMMARY


Fixes #1401
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

vmware_guest
ADDITIONAL INFORMATION

Reviewed-by: Mario Lenz <[email protected]>
  • Loading branch information
Tomorrow9 authored Jul 19, 2022
1 parent b1abe47 commit 4df54bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- vmware_guest - Fix no fail attribute issue (https://github.com/ansible-collections/community.vmware/issues/1401).
6 changes: 3 additions & 3 deletions plugins/modules/vmware_guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3373,13 +3373,13 @@ def main():
# Check requirements for virtualization based security
if pyv.params['hardware']['virt_based_security']:
if not pyv.params['hardware']['nested_virt']:
pyv.module.fail("Virtualization based security requires nested virtualization. Please enable nested_virt.")
pyv.module.fail_json(msg="Virtualization based security requires nested virtualization. Please enable nested_virt.")

if not pyv.params['hardware']['secure_boot']:
pyv.module.fail("Virtualization based security requires (U)EFI secure boot. Please enable secure_boot.")
pyv.module.fail_json(msg="Virtualization based security requires (U)EFI secure boot. Please enable secure_boot.")

if not pyv.params['hardware']['iommu']:
pyv.module.fail("Virtualization based security requires I/O MMU. Please enable iommu.")
pyv.module.fail_json(msg="Virtualization based security requires I/O MMU. Please enable iommu.")

# Check if the VM exists before continuing
vm = pyv.get_vm()
Expand Down

0 comments on commit 4df54bc

Please sign in to comment.