Skip to content

Commit

Permalink
Update cpsadduser.py
Browse files Browse the repository at this point in the history
Corrected call to create_user (added empty uuid parameter)
Show more info on failing call
  • Loading branch information
engbert committed Mar 31, 2014
1 parent 1e29a68 commit 4800b06
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions conpaas-director/cpsadduser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
password, p2 = pprompt()

try:
create_user(username, "", "", email, "", password, credit)
except sqlalchemy.exc.IntegrityError:
create_user(username, "", "", email, "", password, credit, "")
# here we don't fill in: fname, lname, affiliation, uuid
except sqlalchemy.exc.IntegrityError as e:
print "User %s already present" % username

print "Statement: %s" % e.statement
print "Orig: %s" % e.orig
print "Params: %s" % json.dumps(e.params)

common.chown(common.config_parser.get('director',
'DATABASE_URI').replace('sqlite:///', ''), 'www-data', 'www-data')

0 comments on commit 4800b06

Please sign in to comment.