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:
parent
5242914ae5
commit
591695932e
2 changed files with 3 additions and 6 deletions
|
@ -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] == '/':
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue