ldapsync: add a --source-filter parameter

This commit is contained in:
Benjamin Dauvergne 2016-02-17 18:00:43 +01:00
parent d3d8d3e8f5
commit 9797c45ead
1 changed files with 4 additions and 1 deletions

View File

@ -61,6 +61,8 @@ Base DN of the source is remapped to another DN in the target directory''')
help='bind DN for a source LDAP directory')
parser.add_argument('--source-bind-password',
help='bind password for a source LDAP directory')
parser.add_argument('--source-filter',
help='filter to apply to a source LDAP directory')
parser.add_argument('--target-uri',
type=source_uri,
@ -112,7 +114,8 @@ Base DN of the source is remapped to another DN in the target directory''')
elif options.source_bind_dn and options.source_bind_password:
conn.simple_bind_s(options.source_bind_dn, options.source_bind_password)
source = ldap_source.LDAPSource(conn, base_dn=options.source_base_dn, attributes=attributes)
source = ldap_source.LDAPSource(conn, base_dn=options.source_base_dn, attributes=attributes,
filterstr=options.source_filter)
if options.verbose:
print 'to', options.target_uri