Ignore:
Timestamp:
Nov 15, 2016, 11:28:19 AM (8 years ago)
Author:
joergs
Message:

cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dassldapsync/dassldapsync.py

    r1219 r1220  
    8282    return results
    8383
    84 class LdapSync:
     84class LdapSync(object):
    8585    def __init__(self, destserver,destbinddn,destbindpw,srcbasedn,destbasedn,options=Options()):
    8686        self.logger = logging.getLogger()
     
    9696        self.con = None
    9797       
    98         self.attrmap=ldap.cidict.cidict({
    99         })
    100         self.classmap={
    101         }
     98        self.attrmap=ldap.cidict.cidict({})
     99        self.classmap={}
    102100
    103101        self.junk_attrs = [ "memberof", "modifiersname", "modifytimestamp", "entryuuid", "entrycsn", "contextcsn", "creatorsname", "createtimestamp", "structuralobjectclass", "pwdchangedtime", "pwdfailuretime" ]
     
    264262                    self.notify_created(dn)
    265263                    result['add']['ok'].append(dn)
    266                 except (ldap.OBJECT_CLASS_VIOLATION,ldap.NO_SUCH_OBJECT):
     264                except (ldap.OBJECT_CLASS_VIOLATION, ldap.NO_SUCH_OBJECT, ldap.CONSTRAINT_VIOLATION):
    267265                    self.logger.warning("failed to add {}".format(dn))
    268266                    result['add']['failed'].append(dn)
     
    360358
    361359
    362 
    363 
    364360if __name__ == "__main__":
    365361    logging.basicConfig(format='%(levelname)s %(module)s.%(funcName)s: %(message)s', level=logging.INFO)
Note: See TracChangeset for help on using the changeset viewer.