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
commit 7e4b1ebff5
19 changed files with 94 additions and 94 deletions

View file

@ -98,7 +98,7 @@ def save_user(module, cdb_id, name, password, databases, host):
try:
instance = cdb.get(cdb_id)
except Exception, e:
except Exception as e:
module.fail_json(msg='%s' % e.message)
changed = False
@ -112,7 +112,7 @@ def save_user(module, cdb_id, name, password, databases, host):
password=password,
database_names=databases,
host=host)
except Exception, e:
except Exception as e:
module.fail_json(msg='%s' % e.message)
else:
changed = True
@ -134,7 +134,7 @@ def save_user(module, cdb_id, name, password, databases, host):
new_dbs = [db for db in databases if db not in former_dbs]
user.grant_user_access(db_names=new_dbs)
except Exception, e:
except Exception as e:
module.fail_json(msg='%s' % e.message)
else:
changed = True
@ -153,7 +153,7 @@ def delete_user(module, cdb_id, name):
try:
instance = cdb.get(cdb_id)
except Exception, e:
except Exception as e:
module.fail_json(msg='%s' % e.message)
changed = False
@ -163,7 +163,7 @@ def delete_user(module, cdb_id, name):
if user:
try:
user.delete()
except Exception, e:
except Exception as e:
module.fail_json(msg='%s' % e.message)
else:
changed = True