mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
Rundeck modules fixes and improvements (#6300)
* feat: add token alias to api_token parameter * fix: return (None, info) on empty content response * feat: update the modules for using module_utils.rundeck funcs * docs: add changelog fragment * fix: add trailing commas * fix: changelog fragment invalid syntax * fix: changelog typos * fix: remove token aliases from api_token * fix: add token alias to api_token param * fix: add partial overwrite of params and docs
This commit is contained in:
parent
cb3ca05bd1
commit
a35542d0d1
4 changed files with 106 additions and 134 deletions
|
@ -81,12 +81,18 @@ def api_request(module, endpoint, data=None, method="GET"):
|
|||
|
||||
try:
|
||||
content = response.read()
|
||||
json_response = json.loads(content)
|
||||
return json_response, info
|
||||
|
||||
if not content:
|
||||
return None, info
|
||||
else:
|
||||
json_response = json.loads(content)
|
||||
return json_response, info
|
||||
except AttributeError as error:
|
||||
module.fail_json(msg="Rundeck API request error",
|
||||
exception=to_native(error),
|
||||
execution_info=info)
|
||||
module.fail_json(
|
||||
msg="Rundeck API request error",
|
||||
exception=to_native(error),
|
||||
execution_info=info
|
||||
)
|
||||
except ValueError as error:
|
||||
module.fail_json(
|
||||
msg="No valid JSON response",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue