Fixing Rackspace compile time errors irt exception handling for Python 3 (#3849)

This commit is contained in:
@ 2016-06-03 06:39:59 -07:00 committed by Matt Clay
parent 7960e99310
commit 7e4b1ebff5
19 changed files with 94 additions and 94 deletions

View file

@ -192,7 +192,7 @@ def main():
if virtualenv:
try:
_activate_virtualenv(virtualenv)
except IOError, e:
except IOError as e:
module.fail_json(msg='Failed to activate virtualenv %s (%s)' % (
virtualenv, e))
@ -205,7 +205,7 @@ def main():
try:
lb = pyrax.cloud_loadbalancers.get(load_balancer_id)
except pyrax.exc.PyraxException, e:
except pyrax.exc.PyraxException as e:
module.fail_json(msg='%s' % e.message)
node = _get_node(lb, node_id, address, port)
@ -220,7 +220,7 @@ def main():
result = {}
except pyrax.exc.NotFound:
module.exit_json(changed=False, state=state)
except pyrax.exc.PyraxException, e:
except pyrax.exc.PyraxException as e:
module.fail_json(msg='%s' % e.message)
else: # present
if not node:
@ -237,7 +237,7 @@ def main():
weight=weight, type=typ)
resp, body = lb.add_nodes([node])
result.update(body['nodes'][0])
except pyrax.exc.PyraxException, e:
except pyrax.exc.PyraxException as e:
module.fail_json(msg='%s' % e.message)
else: # Updating an existing node
mutable = {
@ -258,7 +258,7 @@ def main():
# type; this should probably be fixed in pyrax
lb.update_node(node, diff=mutable)
result.update(mutable)
except pyrax.exc.PyraxException, e:
except pyrax.exc.PyraxException as e:
module.fail_json(msg='%s' % e.message)
if wait: