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 DigitalOcean module_util (#36352)

This commit is contained in:
ABond 2018-02-17 21:17:26 -05:00 committed by Abhijeet Kasurde
parent 5242914ae5
commit 591695932e
2 changed files with 3 additions and 6 deletions

View file

@ -62,16 +62,15 @@ class DigitalOceanHelper:
def __init__(self, module):
self.module = module
self.baseurl = 'https://api.digitalocean.com/v2'
self.oauth_token = None
self.timeout = module.params.get('timeout', 30)
self.oauth_token = module.params.get('oauth_token')
self.headers = {'Authorization': 'Bearer {0}'.format(self.oauth_token),
'Content-type': 'application/json'}
# Check if api_token is valid or not
response = self.get('account')
if response.status_code == 401:
module.fail_json(msg='Failed to login using API token, please verify validity of API token.')
self.timeout = module.params.get('timeout', 30)
self.module.fail_json(msg='Failed to login using API token, please verify validity of API token.')
def _url_builder(self, path):
if path[0] == '/':

View file

@ -670,11 +670,9 @@ lib/ansible/modules/cloud/digital_ocean/digital_ocean.py E326
lib/ansible/modules/cloud/digital_ocean/digital_ocean_floating_ip.py E322
lib/ansible/modules/cloud/digital_ocean/digital_ocean_floating_ip.py E324
lib/ansible/modules/cloud/digital_ocean/digital_ocean_floating_ip.py E325
lib/ansible/modules/cloud/digital_ocean/digital_ocean_floating_ip_facts.py E325
lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py E322
lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py E324
lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py E325
lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey_facts.py E325
lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py E325
lib/ansible/modules/cloud/dimensiondata/dimensiondata_network.py E326
lib/ansible/modules/cloud/dimensiondata/dimensiondata_vlan.py E324