Added --exclude-attributes parameter
This commit is contained in:
parent
0c32a0d67d
commit
b685053626
1 changed files with 15 additions and 0 deletions
|
@ -104,6 +104,14 @@ parser.add_option( "-a", "--attributes",
|
||||||
help="Check attributes values (Default : check only entryCSN)",
|
help="Check attributes values (Default : check only entryCSN)",
|
||||||
default=False)
|
default=False)
|
||||||
|
|
||||||
|
parser.add_option( "--exclude-attributes",
|
||||||
|
dest="excl_attrs",
|
||||||
|
action="store",
|
||||||
|
type='string',
|
||||||
|
help="Don't check this attribut (only in attribute check mode)",
|
||||||
|
default=None)
|
||||||
|
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
if not options.provider or not options.consumer:
|
if not options.provider or not options.consumer:
|
||||||
|
@ -118,6 +126,11 @@ if not options.basedn:
|
||||||
print "You must provide base DN of connection to LDAP servers"
|
print "You must provide base DN of connection to LDAP servers"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
excl_attrs=[]
|
||||||
|
if options.excl_attrs:
|
||||||
|
for ex in options.excl_attrs.split(','):
|
||||||
|
excl_attrs.append(ex.strip())
|
||||||
|
|
||||||
FORMAT="%(asctime)s - %(levelname)s : %(message)s"
|
FORMAT="%(asctime)s - %(levelname)s : %(message)s"
|
||||||
|
|
||||||
if options.debug:
|
if options.debug:
|
||||||
|
@ -237,6 +250,8 @@ for obj in LdapObjects[options.provider]:
|
||||||
if options.attrs:
|
if options.attrs:
|
||||||
attrs_list=[]
|
attrs_list=[]
|
||||||
for attr in LdapObjects[options.provider][obj]:
|
for attr in LdapObjects[options.provider][obj]:
|
||||||
|
if attr in excl_attrs:
|
||||||
|
continue
|
||||||
if attr not in LdapObjects[srv][obj]:
|
if attr not in LdapObjects[srv][obj]:
|
||||||
attrs_list.append(attr)
|
attrs_list.append(attr)
|
||||||
logging.debug("Obj %s not synchronized : %s not present on %s" % (obj,','.join(attrs_list),srv))
|
logging.debug("Obj %s not synchronized : %s not present on %s" % (obj,','.join(attrs_list),srv))
|
||||||
|
|
Loading…
Reference in a new issue