From: joey <> Date: Sat, 11 Aug 2007 12:53:37 +0000 (+0000) Subject: Return a real error when the group cannot be found out X-Git-Tag: debian_userdir-ldap_0-3-14~4 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=685de8c801ade6d02e7c5033bf474036ffa57dbb Return a real error when the group cannot be found out --- diff --git a/userdir_ldap.py b/userdir_ldap.py index cfd2c45..a048299 100644 --- a/userdir_ldap.py +++ b/userdir_ldap.py @@ -412,8 +412,11 @@ def GetUID(l,Name,UnknownMap = {}): return (None,None); def Group2GID(name): - """Returns the numerical id of a common group""" + """ + Returns the numerical id of a common group + on error returns -1 + """ for g in DebianGroups.keys(): if name == g: return DebianGroups[g] - return name + return -1