Changeset 1220 for dassldapsync


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

cleanup

Location:
dassldapsync
Files:
2 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)
  • dassldapsync/dassldapsync.spec

    r1218 r1220  
    66Group: other
    77BuildArch: noarch
    8 URL: http://www.dass-it.de/dassldapsync
     8URL: http://trac.dass-it.de/pub/browser/dassldapsync
    99
    1010Source: %{name}_%{version}.tar.gz
     
    1313Requires: python >= 2.6
    1414Requires: python-ldap
     15
    1516%description
    1617This script compares two different LDAP subtrees and makes
     
    2425
    2526%build
     27
    2628%install
    2729mkdir -p "%{buildroot}/usr/sbin"
     
    2931install -m 644 dassldapsync.conf %{buildroot}/etc/dassldapsync.conf
    3032install -m 755 dassldapsync.py %{buildroot}/usr/sbin/dassldapsync
     33
    3134%clean
    3235%{__rm} -rf %{buildroot}
     
    3437%files
    3538%defattr(-,root,root)
    36 %config /etc/dassldapsync.conf
     39%config(noreplace) /etc/dassldapsync.conf
    3740/usr/sbin/dassldapsync
     41
    3842%changelog
    3943* Wed Mar 05 2014 Sebastian Lederer slederer@dass-it.de 1.5
Note: See TracChangeset for help on using the changeset viewer.