Skip to content
Snippets Groups Projects
Commit 9d5b91df authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Add modrdn, fix bugs

parent 18a366e4
No related branches found
No related tags found
1 merge request!12Deltalogparse
......@@ -19,7 +19,7 @@ log_path = '/var/log/ldap/'
log_file_log = log_path + 'deltalogparse.log'
log_file_deltalog = log_path + 'delta.log'
search_base = 'cn=deltalog'
object_classes = '(|(objectClass=auditModify)(objectClass=auditAdd)(objectClass=auditDelete))'
object_classes = '(|(objectClass=auditModify)(objectClass=auditAdd)(objectClass=auditDelete)(objectClass=auditModRDN))'
log = logging.getLogger('log')
log.setLevel(log_level)
......@@ -73,10 +73,11 @@ def is_skipped(entry):
def filtered(entry):
"""Filter out attributes not of interest"""
for attribute in entry['attributes']['reqMod']:
if rgx_filter.search(attribute):
log.info('filter attribute: {}'.format(attribute))
entry['attributes']['reqMod'].remove(attribute)
if 'reqMod' in entry['attributes']:
for attribute in entry['attributes']['reqMod']:
if rgx_filter.search(attribute):
log.info('filter attribute: {}'.format(attribute))
entry['attributes']['reqMod'].remove(attribute)
del entry['raw_dn']
del entry['raw_attributes']
......@@ -159,6 +160,7 @@ def main():
log.exception('error: reading socket! trying to reconnect...')
if slapd.reconnect():
log.error('socket reconnected.')
continue
if response:
for entry in slapd.response():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment