Fixed attributes check : added sort of values before comparing

This commit is contained in:
Benjamin Renard 2013-02-26 13:45:36 +01:00
parent bd98262e54
commit 27a62825f2

View file

@ -240,10 +240,14 @@ for obj in LdapObjects[options.provider]:
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))
elif LdapObjects[srv][obj][attr]!=LdapObjects[options.provider][obj][attr]: else:
attrs_list.append(attr) LdapObjects[srv][obj][attr].sort()
logging.debug("Obj %s not synchronized : %s not same value(s)" % (obj,','.join(attrs_list))) LdapObjects[options.provider][obj][attr].sort()
not_sync[srv].append("%s (%s)" % (obj,','.join(attrs_list))) if LdapObjects[srv][obj][attr]!=LdapObjects[options.provider][obj][attr]:
attrs_list.append(attr)
logging.debug("Obj %s not synchronized : %s not same value(s)" % (obj,','.join(attrs_list)))
if len(attrs_list)>0:
not_sync[srv].append("%s (%s)" % (obj,','.join(attrs_list)))
else: else:
logging.debug("Obj %s not synchronized : %s <-> %s" % (obj,LdapObjects[options.provider][obj],LdapObjects[srv][obj])) logging.debug("Obj %s not synchronized : %s <-> %s" % (obj,LdapObjects[options.provider][obj],LdapObjects[srv][obj]))
not_sync[srv].append(obj) not_sync[srv].append(obj)