From: Eric Price Date: Mon, 21 Apr 2008 21:29:42 +0000 (-0400) Subject: Nicer error message on admin not being a group. X-Git-Tag: sipb-xen-www/3.4~34 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/04544797be5fe1519f9218a3bb8f5b0d33b3e6c5 Nicer error message on admin not being a group. svn path=/trunk/packages/sipb-xen-www/; revision=431 --- diff --git a/code/validation.py b/code/validation.py index 4886638..3f05017 100644 --- a/code/validation.py +++ b/code/validation.py @@ -162,7 +162,10 @@ def testAdmin(user, admin, machine): if user in getafsgroups.getAfsGroupMembers(admin, 'athena.mit.edu'): return admin except getafsgroups.AfsProcessError, e: - raise InvalidInput('administrator', admin, str(e)) + errmsg = str(e) + if errmsg.startswith("pts: User or group doesn't exist"): + errmsg = 'The group "%s" does not exist.' % admin + raise InvalidInput('administrator', admin, errmsg) #XXX Should we require that user is in the admin group? return admin