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

@@ -109,7 +109,7 @@ def rax_keypair(module, name, public_key, state):
f = open(public_key)
public_key = f.read()
f.close()
except Exception, e:
except Exception as e:
module.fail_json(msg='Failed to load %s' % public_key)
try:
@@ -118,9 +118,9 @@ def rax_keypair(module, name, public_key, state):
try:
keypair = cs.keypairs.create(name, public_key)
changed = True
except Exception, e:
except Exception as e:
module.fail_json(msg='%s' % e.message)
except Exception, e:
except Exception as e:
module.fail_json(msg='%s' % e.message)
elif state == 'absent':
@@ -133,7 +133,7 @@ def rax_keypair(module, name, public_key, state):
try:
keypair.delete()
changed = True
except Exception, e:
except Exception as e:
module.fail_json(msg='%s' % e.message)
module.exit_json(changed=changed, keypair=rax_to_dict(keypair))