1
0
Fork 0
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:
James J Porter 2020-07-05 02:01:52 -04:00 committed by GitHub
parent c6ec384c24
commit 6b852d841f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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).

View file

@ -79,7 +79,7 @@ def core(module):
tag_name = module.params.get('tag_name', None)
rest = DigitalOceanHelper(module)
base_url = 'tags?'
base_url = 'tags'
if tag_name is not None:
response = rest.get("%s/%s" % (base_url, tag_name))
status_code = response.status_code
@ -90,7 +90,7 @@ def core(module):
resp_json = response.json
tag = resp_json['tag']
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)