summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Scherer <mscherer@users.noreply.github.com>2016-05-17 02:30:25 +0200
committerToshio Kuratomi <a.badger@gmail.com>2016-05-16 17:30:25 -0700
commitfb2355e47d6567b497b083522e8228c1cb4b5be8 (patch)
tree39272cc16aa1d273916b70dda5c0bfc3d106b141
parent376fc21f92e9faf01d582a3e4c4948e5f198cc1d (diff)
downloadansible-fb2355e47d6567b497b083522e8228c1cb4b5be8.tar.gz
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.
-rw-r--r--lib/ansible/module_utils/rax.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ansible/module_utils/rax.py b/lib/ansible/module_utils/rax.py
index ad7afeb3ec..213a215556 100644
--- a/lib/ansible/module_utils/rax.py
+++ b/lib/ansible/module_utils/rax.py
@@ -163,7 +163,7 @@ def rax_find_volume(module, rax_module, name):
volume = cbs.find(name=name)
except rax_module.exc.NotFound:
volume = None
- except Exception, e:
+ except Exception as e:
module.fail_json(msg='%s' % e)
return volume
@@ -302,7 +302,7 @@ def setup_rax_module(module, rax_module, region_required=True):
os.environ.get('RAX_CREDS_FILE'))
region = (region or os.environ.get('RAX_REGION') or
rax_module.get_setting('region'))
- except KeyError, e:
+ except KeyError as e:
module.fail_json(msg='Unable to load %s' % e.message)
try:
@@ -317,7 +317,7 @@ def setup_rax_module(module, rax_module, region_required=True):
rax_module.set_credential_file(credentials, region=region)
else:
raise Exception('No credentials supplied!')
- except Exception, e:
+ except Exception as e:
if e.message:
msg = str(e.message)
else: