:param from_dnstr: search for this from server entry
"""
- #XXX is this connection always unique?
+ answer = []
for connect in self.connect_table.values():
if connect.get_from_dnstr() == from_dnstr:
- return connect
- return None
+ answer.append(connect)
+
+ return answer
def dumpstr_current_replica_table(self):
'''Debug dump string output of current replica table'''
is a corresponding nTDSConnection object in the dsa.
"""
for edge_dnstr in self.edge_from:
- connect = dsa.get_connection_by_from_dnstr(edge_dnstr)
+ connections = dsa.get_connection_by_from_dnstr(edge_dnstr)
# For each edge directed to the NC replica that
# "should be present" on the local DC, the KCC determines
# the DC on which ri "is present".
#
# c.options does not contain NTDSCONN_OPT_RODC_TOPOLOGY
- if connect and not connect.is_rodc_topology():
+
+ found_valid = False
+ for connect in connections:
+ if connect.is_rodc_topology():
+ continue
+ found_valid = True
+
+ if found_valid:
continue
+
# if no such object exists then the KCC adds an object
# c with the following attributes
else:
return False, None
- def translate_ntdsconn(self):
+ def translate_ntdsconn(self, current_dsa=None):
"""This function adjusts values of repsFrom abstract attributes of NC
replicas on the local DC to match those implied by
nTDSConnection objects.
[MS-ADTS] 6.2.2.5
"""
- if self.my_dsa.is_translate_ntdsconn_disabled():
+ count = 0
+
+ if current_dsa is None:
+ current_dsa = self.my_dsa
+
+ if current_dsa.is_translate_ntdsconn_disabled():
logger.debug("skipping translate_ntdsconn() "
"because disabling flag is set")
return
logger.debug("translate_ntdsconn(): enter")
- current_rep_table, needed_rep_table = self.my_dsa.get_rep_tables()
+ current_rep_table, needed_rep_table = current_dsa.get_rep_tables()
# Filled in with replicas we currently have that need deleting
delete_reps = set()
# Retrieve my DSAs connection object (if it exists)
# that specifies the fromServer equivalent to
# the DSA that is specified in the repsFrom source
- cn_conn = self.my_dsa.get_connection_by_from_dnstr(s_dnstr)
+ connections = current_dsa.get_connection_by_from_dnstr(s_dnstr)
+
+ count = 0
+ cn_conn = None
+
+ for con in connections:
+ if con.is_rodc_topology():
+ continue
+ cn_conn = con
# Let (cn) be the nTDSConnection object such that (cn)
# is a child of the local DC's nTDSDSA object and
# [...]
#XXX varying possible interpretations of rodc_topology
- if cn_conn is None or cn_conn.is_rodc_topology():
+ if cn_conn is None:
t_repsFrom.to_be_deleted = True
continue
# Loop thru connections and add implied repsFrom tuples
# for each NTDSConnection under our local DSA if the
# repsFrom is not already present
- for cn_conn in self.my_dsa.connect_table.values():
+ for cn_conn in current_dsa.connect_table.values():
implied, s_dsa = self.is_repsFrom_implied(n_rep, cn_conn)
if not implied:
# to have the correct attributes above
for t_repsFrom in n_rep.rep_repsFrom:
guidstr = str(t_repsFrom.source_dsa_obj_guid)
- #XXXX what?
+ #XXX what?
if s_dsa is self.get_dsa_by_guidstr(guidstr):
s_dsa = None
break