[Da-tools-commits] ./da-tools/userdir-ldap-common r375: Don't convert strings to integers, just check that they could be converted.
Mark Hymers
mhy at debian.org
Thu Jan 10 13:44:07 UTC 2008
------------------------------------------------------------
revno: 375
committer: Mark Hymers <mhy at debian.org>
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)
modified:
ud-userimport
-------------- next part --------------
=== modified file 'ud-userimport'
--- a/ud-userimport 2008-01-10 12:58:39 +0000
+++ b/ud-userimport 2008-01-10 13:44:07 +0000
@@ -83,8 +83,10 @@
Split = re.split("[:\n]",Line);
(Split[4],cn,mn,sn) = ParseGecos(Split[4]);
- 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]),
More information about the Da-tools-commits
mailing list