View | Details | Raw Unified | Return to bug 51236
Collapse All | Expand All

(-)a/management/univention-directory-replication/replication.py (-22 / +23 lines)
 Lines 829-858   def handler(dn, new, listener_old, operation): Link Here 
829
		if not isinstance(l, LDIFObject):
829
		if not isinstance(l, LDIFObject):
830
			old = getOldValues(l, dn)
830
			old = getOldValues(l, dn)
831
831
832
			# Check if both entries really match
832
			if ud.get_level(ud.LISTENER) >= ud.INFO:
833
			match = 1
833
				# Check if both entries really match
834
			if len(old) != len(listener_old):
834
				match = 1
835
				ud.debug(ud.LISTENER, ud.INFO, 'replication: LDAP keys=%s; listener keys=%s' % (list(old.keys()), list(listener_old.keys())))
835
				if len(old) != len(listener_old):
836
				match = 0
836
					ud.debug(ud.LISTENER, ud.INFO, 'replication: LDAP keys=%s; listener keys=%s' % (list(old.keys()), list(listener_old.keys())))
837
			else:
837
					match = 0
838
				for k in old:
838
				else:
839
					if k in EXCLUDE_ATTRIBUTES:
839
					for k in old:
840
						continue
840
						if k in EXCLUDE_ATTRIBUTES:
841
					if k not in listener_old:
841
							continue
842
						ud.debug(ud.LISTENER, ud.INFO, 'replication: listener does not have key %s' % (k,))
842
						if k not in listener_old:
843
						match = 0
843
							ud.debug(ud.LISTENER, ud.INFO, 'replication: listener does not have key %s' % (k,))
844
						break
844
							match = 0
845
					if len(old[k]) != len(listener_old[k]):
845
							break
846
						ud.debug(ud.LISTENER, ud.INFO, 'replication: LDAP and listener values diff for %s' % (k,))
846
						if len(old[k]) != len(listener_old[k]):
847
						match = 0
847
							ud.debug(ud.LISTENER, ud.INFO, 'replication: LDAP and listener values diff for %s' % (k,))
848
						break
849
					for v in old[k]:
850
						if v not in listener_old[k]:
851
							ud.debug(ud.LISTENER, ud.INFO, 'replication: listener does not have value for key %s' % (k,))
852
							match = 0
848
							match = 0
853
							break
849
							break
854
			if not match:
850
						for v in old[k]:
855
				ud.debug(ud.LISTENER, ud.INFO, 'replication: old entries from LDAP server and Listener do not match')
851
							if v not in listener_old[k]:
852
								ud.debug(ud.LISTENER, ud.INFO, 'replication: listener does not have value for key %s' % (k,))
853
								match = 0
854
								break
855
				if not match:
856
					ud.debug(ud.LISTENER, ud.INFO, 'replication: old entries from LDAP server and Listener do not match')
856
		else:
857
		else:
857
			old = listener_old
858
			old = listener_old
858
859

Return to bug 51236