Merge from alioth
authorPeter Palfrader <peter@palfrader.org>
Thu, 10 Jan 2008 13:50:25 +0000 (14:50 +0100)
committerPeter Palfrader <peter@palfrader.org>
Thu, 10 Jan 2008 13:50:25 +0000 (14:50 +0100)
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 <mhy@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)
  --
  revno: 376
  committer: Mark Hymers <mhy@debian.org>
  branch nick: userdir-ldap-common
  timestamp: Thu 2008-01-10 13:48:43 +0000
  message:
    and some more old CheckNumber fixes

1  2 
debian/changelog
ud-userimport

diff --combined debian/changelog
@@@ -11,16 -11,6 +11,16 @@@ userdir-ldap (0.3.15+xxx) XXunstable; u
    * Change the build dependency on python-support to be versioned >= 0.3.
    * ud-roleadd: Do not try to make role accounts of objectClass
      inetOrgPerson, that doesn't work.
 +  * ud-fingerserv: implement daemonize() for non-inetd mode [sgran].
 +  * ud-useradd: support usergroups [HE].
 +  * ud-host/userdir-ldap.schema: Add 'purpose', 'physicalHost' to
 +    debianServer schema and teach ud-host about [HE].
 +  * ud-host: cleanup: Replace local copy HBaseDn of the centrally
 +    configured HostBaseDn [HE].
 +  * Add myself to uploaders.
 +  * ud-generate: Set shadow expiry to 1 for locked accounts [mhy].
 +  * update doc/slapd-config.txt: labeledURL was removed from the schema but
 +    not the slapd.conf example.  Do that now [mhy].
  
    [ Mark Hymers ]
    * ud-userimport, ud-groupadd, ud-roleadd, ud-useradd, userdir_ldap.py:
@@@ -28,8 -18,9 +28,9 @@@
      ud-{user,group,role}add and abstract them out into userdir_ldap.py
    * ud-useradd: Avoid a TypeError exception when constructing the template
      filename
+   * Remove use of deprecated functions from the string module 
  
-  -- Mark Hymers <mhy@debian.org>  Wed, 26 Dec 2007 18:00:08 +0000
+  -- Mark Hymers <mhy@debian.org>  Wed, 26 Dec 2007 20:49:18 +0000
  
  userdir-ldap (0.3.15) unstable; urgency=low
  
diff --combined ud-userimport
@@@ -37,7 -37,7 +37,7 @@@
  #  ldapimport -s /etc/shadow -g /etc/group
  # 
  
- import string, re, time, ldap, getopt, sys;
+ import re, time, ldap, getopt, sys;
  from userdir_ldap import *;
  
  DoAdd = 0;
@@@ -71,11 -71,6 +71,6 @@@ def ParseGecos(Field)
             Gecos[3] + "," + Gecos[4];
     return (Field,cn,mn,sn);
  
- # Check if a number string is really a number
- def CheckNumber(Num):
-    for x in Num:
-       string.index(string.digits,x);
  # Read the passwd file into the database
  def DoPasswd(l,Passwd):
     # Read the passwd file and import it
  
        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]),
  
        if (DoAdd == 1):
           try:
 -            AddRec = Rec
 -            Rec.append(("objectClass", UserObjectClasses))
 +            AddRec = Rec[:]
 +            AddRec.append(("objectClass", UserObjectClasses))
              l.add_s(Dn,AddRec)
              DoModify = False
  
@@@ -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