self.site_topo_generator = None
self.site_topo_failover = 0 # appears to be in minutes
self.dsa_table = {}
+ self.rw_dsa_table = {}
self.unix_now = unix_now
def load_site(self, samdb):
# Assign this dsa to my dsa table
# and index by dsa dn
self.dsa_table[dnstr] = dsa
+ if not dsa.is_ro():
+ self.rw_dsa_table[dnstr] = dsa
- def get_dsa_by_guidstr(self, guidstr):
+
+ def get_dsa_by_guidstr(self, guidstr): #XXX unused
for dsa in self.dsa_table.values():
if str(dsa.dsa_guid) == guidstr:
return dsa
# Which is a fancy way of saying "sort all the nTDSDSA objects
# in the site by guid in ascending order". Place sorted list
# in D_sort[]
- D_sort = sorted(self.dsa_table.values(), cmp=sort_dsa_by_guid)
+ D_sort = sorted(self.rw_dsa_table.values(), cmp=sort_dsa_by_guid)
ntnow = unix2nttime(self.unix_now) # double word number of 100 nanosecond
# intervals since 1600s
self.my_dsa = self.my_site.get_dsa(self.my_dsa_dnstr)
+ if self.my_dsa_dnstr not in self.dsa_by_dnstr:
+ DEBUG_DARK_YELLOW("my_dsa %s isn't in self.dsas_by_dnstr: it must be RODC."
+ "Let's add it, because my_dsa is a special case!\n"
+ "(likewise for self.dsa_by_guid of course)" %
+ self.my_dsas_dnstr)
+
+ self.dsa_by_dnstr[self.my_dsa_dnstr] = self.my_dsa
+ self.dsa_by_guid[str(self.my_dsa.dsa_guid)] = self.my_dsa
+
+
def load_all_partitions(self):
"""Discover all NCs thru the Partitions dn and
instantiate and load the NCs.
DEBUG_RED("get_all_bridgeheads with %s, part%s, partial_ok %s"
" detect_failed %s" % (site.site_dnstr, part.partstr,
partial_ok, detect_failed))
- logger.debug(site.dsa_table)
- for key, dsa in site.dsa_table.items():
+ logger.debug(site.rw_dsa_table)
+ for dsa in site.rw_dsa_table.values():
pdnstr = dsa.get_parent_dnstr()