mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix bug in digital_ocean_tag_info module (#615)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
c6ec384c24
commit
6b852d841f
2 changed files with 4 additions and 2 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- digital_ocean_tag_info - fix crash when querying for an individual tag (https://github.com/ansible-collections/community.general/pull/615).
|
|
@ -79,7 +79,7 @@ def core(module):
|
||||||
tag_name = module.params.get('tag_name', None)
|
tag_name = module.params.get('tag_name', None)
|
||||||
rest = DigitalOceanHelper(module)
|
rest = DigitalOceanHelper(module)
|
||||||
|
|
||||||
base_url = 'tags?'
|
base_url = 'tags'
|
||||||
if tag_name is not None:
|
if tag_name is not None:
|
||||||
response = rest.get("%s/%s" % (base_url, tag_name))
|
response = rest.get("%s/%s" % (base_url, tag_name))
|
||||||
status_code = response.status_code
|
status_code = response.status_code
|
||||||
|
@ -90,7 +90,7 @@ def core(module):
|
||||||
resp_json = response.json
|
resp_json = response.json
|
||||||
tag = resp_json['tag']
|
tag = resp_json['tag']
|
||||||
else:
|
else:
|
||||||
tag = rest.get_paginated_data(base_url=base_url, data_key_name='tags')
|
tag = rest.get_paginated_data(base_url=base_url + '?', data_key_name='tags')
|
||||||
|
|
||||||
module.exit_json(changed=False, data=tag)
|
module.exit_json(changed=False, data=tag)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue