Author: vmotoska Date: 2012-03-22 19:33:54 +0000 (Thu, 22 Mar 2012) New Revision: 5265
Modified: branches/roles/cumin/bin/cumin-admin Log: fix exception on add/remove assignment when invalid user/role specified ( should merge to trunk)
Modified: branches/roles/cumin/bin/cumin-admin =================================================================== --- branches/roles/cumin/bin/cumin-admin 2012-03-22 15:02:04 UTC (rev 5264) +++ branches/roles/cumin/bin/cumin-admin 2012-03-22 19:33:54 UTC (rev 5265) @@ -542,7 +542,6 @@
def handle_remove_assignment(app, cursor, opts, args): user, role = get_user_and_role(app, cursor, args) - #TODO: check if user exists otherwise exc occures assignment = app.admin.get_assignment(cursor, user, role)
if not assignment: @@ -567,6 +566,11 @@ user = app.admin.get_user(cursor, user_name) role = app.admin.get_role(cursor, role_name)
+ if not user: + error("Specified user %s does not exist" % user_name) + if not role: + error("Specified role %s does not exist" % role_name) + return user, role
def handle_change_password(app, cursor, opts, args):
cumin-developers@lists.fedorahosted.org