mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Fixed incorrect response removing a group (#55116)
This commit is contained in:
@@ -35,6 +35,8 @@ version_added: '2.8'
|
||||
author: Evert Mulder (@evertmulder)
|
||||
description:
|
||||
- The manageiq_group module supports adding, updating and deleting groups in ManageIQ.
|
||||
requirements:
|
||||
- manageiq-client
|
||||
|
||||
options:
|
||||
state:
|
||||
@@ -319,10 +321,13 @@ class ManageIQgroup(object):
|
||||
"""
|
||||
try:
|
||||
url = '%s/groups/%s' % (self.api_url, group['id'])
|
||||
self.client.post(url, action='delete')
|
||||
result = self.client.post(url, action='delete')
|
||||
except Exception as e:
|
||||
self.module.fail_json(msg="failed to delete group %s: %s" % (group['description'], str(e)))
|
||||
|
||||
if result['success'] is False:
|
||||
self.module.fail_json(msg=result['message'])
|
||||
|
||||
return dict(
|
||||
changed=True,
|
||||
msg="deleted group %s with id %i" % (group['description'], group['id']))
|
||||
@@ -610,7 +615,7 @@ def main():
|
||||
else:
|
||||
res_args = dict(
|
||||
changed=False,
|
||||
msg="group %s: does not exist in manageiq" % description)
|
||||
msg="group '%s' does not exist in manageiq" % description)
|
||||
|
||||
# group should exist
|
||||
if state == "present":
|
||||
|
||||
Reference in New Issue
Block a user