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:
Phillipe Smith 2023-04-16 08:23:39 -03:00 committed by GitHub
parent cb3ca05bd1
commit a35542d0d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 106 additions and 134 deletions

View file

@ -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",