Fixed attributes check : added sort of values before comparing
Benjamin Renard

Benjamin Renard commited on 2013-02-26 12:45:36
Showing 1 changed files, with 5 additions and 1 deletions.

... ...
@@ -240,9 +240,13 @@ for obj in LdapObjects[options.provider]:
240 240
 						if attr not in LdapObjects[srv][obj]:
241 241
 							attrs_list.append(attr)
242 242
 							logging.debug("Obj %s not synchronized : %s not present on %s" % (obj,','.join(attrs_list),srv))
243
-						elif LdapObjects[srv][obj][attr]!=LdapObjects[options.provider][obj][attr]:
243
+						else:
244
+							LdapObjects[srv][obj][attr].sort()
245
+							LdapObjects[options.provider][obj][attr].sort()
246
+							if LdapObjects[srv][obj][attr]!=LdapObjects[options.provider][obj][attr]:
244 247
 								attrs_list.append(attr)
245 248
 								logging.debug("Obj %s not synchronized : %s not same value(s)" % (obj,','.join(attrs_list)))
249
+					if len(attrs_list)>0:
246 250
 						not_sync[srv].append("%s (%s)" % (obj,','.join(attrs_list)))
247 251
 				else:
248 252
 					logging.debug("Obj %s not synchronized : %s <-> %s" % (obj,LdapObjects[options.provider][obj],LdapObjects[srv][obj]))
249 253