join.py: Remove special full_ncs handling, we only need to updateRefs on an NC we...
[nivanova/samba-autobuild/.git] / python / samba / join.py
index 2379d5f214d6ccdff6f609afac26668134a42852..2a737bab3c122c43b157d03df2c9970ae110efc7 100644 (file)
@@ -65,7 +65,6 @@ class dc_join(object):
         ctx.promote_from_dn = None
 
         ctx.nc_list = []
-        ctx.full_nc_list = []
 
         ctx.creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
         ctx.net = Net(creds=ctx.creds, lp=ctx.lp)
@@ -119,7 +118,7 @@ class dc_join(object):
         ctx.dnsdomain = ctx.samdb.domain_dns_name()
         ctx.dnsforest = ctx.samdb.forest_dns_name()
         ctx.domaindns_zone = 'DC=DomainDnsZones,%s' % ctx.base_dn
-        ctx.forestdns_zone = 'DC=ForestDnsZones,%s' % ctx.base_dn
+        ctx.forestdns_zone = 'DC=ForestDnsZones,%s' % ctx.root_dn
 
         res_domaindns = ctx.samdb.search(scope=ldb.SCOPE_ONELEVEL,
                                          attrs=[],
@@ -717,7 +716,7 @@ class dc_join(object):
 
         smbconf = ctx.lp.configfile
 
-        presult = provision(ctx.logger, system_session(), None, smbconf=smbconf,
+        presult = provision(ctx.logger, system_session(), smbconf=smbconf,
                 targetdir=ctx.targetdir, samdb_fill=FILL_DRS, realm=ctx.realm,
                 rootdn=ctx.root_dn, domaindn=ctx.base_dn,
                 schemadn=ctx.schema_dn, configdn=ctx.config_dn,
@@ -830,10 +829,6 @@ class dc_join(object):
                                     destination_dsa_guid, rodc=ctx.RODC,
                                     replica_flags=ctx.replica_flags)
 
-            if 'DC=ForestDnsZones,%s' % ctx.root_dn in ctx.nc_list:
-                repl.replicate('DC=ForestDnsZones,%s' % ctx.root_dn, source_dsa_invocation_id,
-                               destination_dsa_guid, rodc=ctx.RODC,
-                               replica_flags=ctx.replica_flags)
             # FIXME At this point we should add an entry in the forestdns and domaindns NC
             # (those under CN=Partions,DC=...)
             # in order to indicate that we hold a replica for this NC
@@ -879,8 +874,8 @@ class dc_join(object):
         # DC we just replicated from then we don't need to send the updatereplicateref
         # as replication between sites is time based and on the initiative of the
         # requesting DC
-        ctx.logger.info("Sending DsReplicateUpdateRefs for all the replicated partitions")
-        for nc in ctx.full_nc_list:
+        ctx.logger.info("Sending DsReplicaUpdateRefs for all the replicated partitions")
+        for nc in ctx.nc_list:
             ctx.send_DsReplicaUpdateRefs(nc)
 
         if ctx.RODC:
@@ -1057,7 +1052,6 @@ class dc_join(object):
         # full_nc_list is the list of naming context (NC) for which we will
         # send a updateRef command to the partner DC
         ctx.nc_list = [ ctx.config_dn, ctx.schema_dn ]
-        ctx.full_nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn ]
 
         if not ctx.subdomain:
             ctx.nc_list += [ctx.base_dn]
@@ -1065,10 +1059,7 @@ class dc_join(object):
                 ctx.nc_list += [ctx.domaindns_zone]
 
         if ctx.dns_backend != "NONE":
-            if not ctx.subdomain:
-                ctx.full_nc_list += ['DC=DomainDnsZones,%s' % ctx.base_dn]
-            ctx.full_nc_list += ['DC=ForestDnsZones,%s' % ctx.root_dn]
-            ctx.nc_list += ['DC=ForestDnsZones,%s' % ctx.root_dn]
+            ctx.nc_list += [ctx.forestdns_zone]
 
         if ctx.promote_existing:
             ctx.promote_possible()