Added --exclude-attributes parameter
Benjamin Renard

Benjamin Renard commited on 2013-05-15 15:31:41
Showing 1 changed files, with 15 additions and 0 deletions.

... ...
@@ -104,6 +104,14 @@ parser.add_option(	"-a", "--attributes",
104 104
 			help="Check attributes values (Default : check only entryCSN)",
105 105
 			default=False)
106 106
 
107
+parser.add_option(	"--exclude-attributes",
108
+			dest="excl_attrs",
109
+			action="store",
110
+			type='string',
111
+			help="Don't check this attribut (only in attribute check mode)",
112
+			default=None)
113
+
114
+
107 115
 (options, args) = parser.parse_args()
108 116
 
109 117
 if not options.provider or not options.consumer:
... ...
@@ -118,6 +126,11 @@ if not options.basedn:
118 126
 	print "You must provide base DN of connection to LDAP servers"
119 127
 	sys.exit(1)
120 128
 
129
+excl_attrs=[]
130
+if options.excl_attrs:
131
+	for ex in options.excl_attrs.split(','):
132
+		excl_attrs.append(ex.strip())
133
+
121 134
 FORMAT="%(asctime)s - %(levelname)s : %(message)s"
122 135
 
123 136
 if options.debug:
... ...
@@ -237,6 +250,8 @@ for obj in LdapObjects[options.provider]:
237 250
 				if options.attrs:
238 251
 					attrs_list=[]
239 252
 					for attr in LdapObjects[options.provider][obj]:
253
+						if attr in excl_attrs:
254
+							continue
240 255
 						if attr not in LdapObjects[srv][obj]:
241 256
 							attrs_list.append(attr)
242 257
 							logging.debug("Obj %s not synchronized : %s not present on %s" % (obj,','.join(attrs_list),srv))
243 258