From: Peter Palfrader Date: Thu, 10 Jan 2008 13:50:25 +0000 (+0100) Subject: Merge from alioth X-Git-Tag: userdir-ldap-0.3.16~17 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=cdba05cbc8f2fa6a8557fd43e6c4e4d5d8e1130c Merge from alioth Replace deprecated string.$foo($bar, $ARGS) calls with $bar.$foo($ARGS). Also cherry pick two fixes on the patch from later in that tree: revno: 375 committer: Mark Hymers branch nick: userdir-ldap-common timestamp: Thu 2008-01-10 13:44:07 +0000 message: Don't convert strings to integers, just check that they could be converted. Noticed by Peter (again) -- revno: 376 committer: Mark Hymers branch nick: userdir-ldap-common timestamp: Thu 2008-01-10 13:48:43 +0000 message: and some more old CheckNumber fixes --- cdba05cbc8f2fa6a8557fd43e6c4e4d5d8e1130c diff --cc ud-userimport index aa580fa,3e926ec..4e044c7 --- a/ud-userimport +++ b/ud-userimport @@@ -88,8 -83,8 +83,10 @@@ def DoPasswd(l,Passwd) Split = re.split("[:\n]",Line); (Split[4],cn,mn,sn) = ParseGecos(Split[4]); - CheckNumber(Split[2]); - CheckNumber(Split[3]); - Split[2] = int(Split[2]) - Split[3] = int(Split[3]) ++ # This just tests whether these are integers and throws an ++ # exception if not ++ int(Split[2]) ++ int(Split[3]) Rec = [("uid",Split[0]), ("uidNumber",Split[2]), ("gidNumber",Split[3]), @@@ -148,7 -143,7 +145,7 @@@ def DoShadow(l,Shadow) continue; for x in range(2,8): - CheckNumber(Split[x]); - Split[x] = int(Split[x]) ++ int(Split[x]) Rec = [(ldap.MOD_REPLACE,"shadowLastChange",Split[2]), (ldap.MOD_REPLACE,"shadowMin",Split[3]), @@@ -189,7 -184,7 +186,7 @@@ def DoGroup(l,Group) # Split up the group information Split = re.split("[:\n]",Line); Members = re.split("[, ]*",Split[3]); - CheckNumber(Split[2]); - Split[2] = int(Split[2]) ++ int(Split[2]) # Iterate over the membership list and add the membership information # To the directory