lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1451 - nss-pam-ldapd/pynslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1451 - nss-pam-ldapd/pynslcd



Author: arthur
Date: Sun May  1 14:06:38 2011
New Revision: 1451
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1451

Log:
small code improvements

Modified:
   nss-pam-ldapd/pynslcd/group.py
   nss-pam-ldapd/pynslcd/pam.py
   nss-pam-ldapd/pynslcd/pynslcd.py

Modified: nss-pam-ldapd/pynslcd/group.py
==============================================================================
--- nss-pam-ldapd/pynslcd/group.py      Sat Apr 30 23:28:04 2011        (r1450)
+++ nss-pam-ldapd/pynslcd/group.py      Sun May  1 14:06:38 2011        (r1451)
@@ -29,6 +29,7 @@
     for i in lst:
         yield i.replace('\0', '')
 
+
 class GroupRequest(common.Request):
 
     filter = '(|(objectClass=posixGroup)(objectClass=groupOfUniqueNames))'
@@ -62,14 +63,12 @@
         if self.wantmembers:
             # add the memberUid values
             for member in clean(attributes.get(self.attmap_group_memberUid, 
[])):
-                #print 'found member %r' % member
                 if common.isvalidname(member):
                     members.add(member)
             # translate and add the uniqueMember values
             from passwd import dn2uid
             for memberdn in 
clean(attributes.get(self.attmap_group_uniqueMember, [])):
                 member = dn2uid(self.conn, memberdn)
-                #print 'found memberdn %r, member=%r' % ( memberdn, member)
                 if member:
                     members.add(member)
         # actually return the results

Modified: nss-pam-ldapd/pynslcd/pam.py
==============================================================================
--- nss-pam-ldapd/pynslcd/pam.py        Sat Apr 30 23:28:04 2011        (r1450)
+++ nss-pam-ldapd/pynslcd/pam.py        Sun May  1 14:06:38 2011        (r1451)
@@ -56,16 +56,16 @@
             # save the DN
             self.userdn = entry[0]
             # get the "real" username
-            value = common.get_rdn_value(entry, 
PasswdRequest.attmap_passwd_uid)
+            value = common.get_rdn_value(entry, 
passwd.PasswdRequest.attmap_passwd_uid)
             if not value:
                 # get the username from the uid attribute
-                values = myldap_get_values(entry, 
PasswdRequest.attmap_passwd_uid)
+                values = myldap_get_values(entry, 
passwd.PasswdRequest.attmap_passwd_uid)
                 if not values or not values[0]:
-                    logging.warn('%s: is missing a %s attribute', entry.dn, 
PasswdRequest.attmap_passwd_uid)
+                    logging.warn('%s: is missing a %s attribute', entry.dn, 
passwd.PasswdRequest.attmap_passwd_uid)
                 value = values[0]
             # check the username
             if value and not common.isvalidname(value):
-                raise ValueError('%s: has invalid %s attribute', entry.dn, 
PasswdRequest.attmap_passwd_uid)
+                raise ValueError('%s: has invalid %s attribute', entry.dn, 
passwd.PasswdRequest.attmap_passwd_uid)
             # check if the username is different and update it if needed
             if value != self.username:
                 logging.info('username changed from %r to %r', self.username, 
value)

Modified: nss-pam-ldapd/pynslcd/pynslcd.py
==============================================================================
--- nss-pam-ldapd/pynslcd/pynslcd.py    Sat Apr 30 23:28:04 2011        (r1450)
+++ nss-pam-ldapd/pynslcd/pynslcd.py    Sun May  1 14:06:38 2011        (r1451)
@@ -68,7 +68,7 @@
              'Copyright (C) 2010, 2011 Arthur de Jong\n'
              'This is free software; see the source for copying conditions.  
There is NO\n'
              'warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.\n'
-             % { 'PACKAGE_STRING': config.PACKAGE_STRING, } );
+             % { 'PACKAGE_STRING': config.PACKAGE_STRING, } )
 
 def display_usage(fp):
     fp.write("Usage: %(program_name)s [OPTION]...\n"
@@ -249,10 +249,10 @@
     with daemon:
         # start normal logging
         if not cfg.debug:
-            log_startlogging();
+            log_startlogging()
         logging.info('version %s starting', config.VERSION)
         # create socket
-        nslcd_serversocket = create_socket();
+        nslcd_serversocket = create_socket()
         # drop all supplemental groups
         try:
             os.setgroups(())
@@ -275,7 +275,7 @@
             thread = threading.Thread(target=worker, name='thread%d' % i)
             thread.setDaemon(True)
             thread.start()
-            logging.debug('started thread %s' % thread.getName())
+            logging.debug('started thread %s', thread.getName())
             threads.append(thread)
         # wait for all threads to die
         for thread in threads:
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits