Changeset 1261 for dassldapsync
- Timestamp:
- May 10, 2022, 10:58:52 AM (2 years ago)
- Location:
- dassldapsync
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
dassldapsync/dassldapsync.conf
r1221 r1261 9 9 #bindPassword=secret 10 10 #filter=(objectclass=*) 11 #excludesubtree=ou=unimportant,dc=example,dc=com 11 12 #attributes=* 12 13 #starttls=true -
dassldapsync/dassldapsync.py
r1260 r1261 105 105 def reset_result(self): 106 106 self.result = { 107 'unmodified': {'ok': [], 'failed': []}, 108 'excluded': {'ok': [], 'failed': []}, 107 109 'add': {'ok': [], 'failed': []}, 108 110 'update': {'ok': [], 'failed': []}, … … 149 151 d = ldap.cidict.cidict(r[1]) 150 152 151 if self.__is_dn_included(dn): 153 if not self.__is_dn_included(dn): 154 self.notify_excluded(dn) 155 else: 152 156 objectclasses = d["objectclass"] 153 157 … … 280 284 281 285 def __syncLdapDestination(self, update_objects): 282 283 286 logger.debug("writing data to destination LDAP") 284 287 for obj in update_objects: … … 339 342 ok = len(result[action]['ok']) 340 343 failed = len(result[action]['failed']) 341 print("{} (ok: {}, failed: {}) :".format(action, ok, failed))342 343 if show_ok and ok > 0:344 print("{} (ok: {}, failed: {})".format(action, ok, failed)) 345 346 if ok > 0 and (show_ok or ok <= 3): 344 347 print("succeeded:") 345 348 print("\n".join(result[action]['ok'])) 346 349 347 if show_failed and failed > 0:350 if failed > 0 and (show_failed or failed <= 3): 348 351 print("failed:") 349 352 print("\n".join(result[action]['failed'])) 353 print() 350 354 351 355 def get_short_dn(self, dn): … … 353 357 354 358 def notify_unchanged(self, dn): 355 logger.debug(u'{} unchanged'.format(self.get_short_dn(dn))) 359 #logger.debug(u'{} unchanged'.format(self.get_short_dn(dn))) 360 self.result['unmodified']['ok'].append(dn) 361 362 def notify_excluded(self, dn): 363 #logger.debug(u'{} unchanged'.format(self.get_short_dn(dn))) 364 self.result['excluded']['ok'].append(dn) 356 365 357 366 def notify_created(self, dn, ok=True): … … 566 575 conffile = args.configfile 567 576 568 exclude = None569 570 577 config = ConfigParser() 571 578 config.read(conffile)
Note:
See TracChangeset
for help on using the changeset viewer.