mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 23:44:00 -07:00
Fixing Rackspace compile time errors irt exception handling for Python 3 (#3849)
This commit is contained in:
parent
7960e99310
commit
7e4b1ebff5
19 changed files with 94 additions and 94 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue