mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
Port rax.py to python3 compatible syntax (#15875)
Since the pyrax website say that only python 2.7 is tested, I do not think it is worth to aim for python 2.4 compatibility for the various rackspace modules.
This commit is contained in:
parent
376fc21f92
commit
fb2355e47d
1 changed files with 3 additions and 3 deletions
|
@ -163,7 +163,7 @@ def rax_find_volume(module, rax_module, name):
|
||||||
volume = cbs.find(name=name)
|
volume = cbs.find(name=name)
|
||||||
except rax_module.exc.NotFound:
|
except rax_module.exc.NotFound:
|
||||||
volume = None
|
volume = None
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
module.fail_json(msg='%s' % e)
|
module.fail_json(msg='%s' % e)
|
||||||
return volume
|
return volume
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ def setup_rax_module(module, rax_module, region_required=True):
|
||||||
os.environ.get('RAX_CREDS_FILE'))
|
os.environ.get('RAX_CREDS_FILE'))
|
||||||
region = (region or os.environ.get('RAX_REGION') or
|
region = (region or os.environ.get('RAX_REGION') or
|
||||||
rax_module.get_setting('region'))
|
rax_module.get_setting('region'))
|
||||||
except KeyError, e:
|
except KeyError as e:
|
||||||
module.fail_json(msg='Unable to load %s' % e.message)
|
module.fail_json(msg='Unable to load %s' % e.message)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -317,7 +317,7 @@ def setup_rax_module(module, rax_module, region_required=True):
|
||||||
rax_module.set_credential_file(credentials, region=region)
|
rax_module.set_credential_file(credentials, region=region)
|
||||||
else:
|
else:
|
||||||
raise Exception('No credentials supplied!')
|
raise Exception('No credentials supplied!')
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
if e.message:
|
if e.message:
|
||||||
msg = str(e.message)
|
msg = str(e.message)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue