provision: Only calculate ForestDNSZone GUID if we need it
authorAndrew Bartlett <abartlet@samba.org>
Wed, 16 Oct 2013 01:43:39 +0000 (14:43 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 31 Aug 2014 22:36:41 +0000 (00:36 +0200)
Change-Id: Ie33812627ce7ececda681c2d784b1ca97b1b73c4
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
python/samba/provision/sambadns.py

index 87fb48630488960df1856b11d5336f43aa6da3a1..66696e83f9d380456055337a8358d4c55cf19817 100644 (file)
@@ -252,13 +252,8 @@ def setup_dns_partitions(samdb, domainsid, domaindn, forestdn, configdn,
         })
 
     domainzone_guid = get_domainguid(samdb, domainzone_dn)
-    forestzone_guid = get_domainguid(samdb, forestzone_dn)
-
     domainzone_guid = str(uuid.uuid4())
-    forestzone_guid = str(uuid.uuid4())
-
     domainzone_dns = ldb.Dn(samdb, domainzone_dn).canonical_ex_str().strip()
-    forestzone_dns = ldb.Dn(samdb, forestzone_dn).canonical_ex_str().strip()
 
     protected1_desc = get_domain_delete_protected1_descriptor(domainsid)
     protected2_desc = get_domain_delete_protected2_descriptor(domainsid)
@@ -278,6 +273,10 @@ def setup_dns_partitions(samdb, domainsid, domaindn, forestdn, configdn,
     })
 
     if fill_level != FILL_SUBDOMAIN:
+        forestzone_guid = get_domainguid(samdb, forestzone_dn)
+        forestzone_guid = str(uuid.uuid4())
+        forestzone_dns = ldb.Dn(samdb, forestzone_dn).canonical_ex_str().strip()
+
         setup_add_ldif(samdb, setup_path("provision_dnszones_add.ldif"), {
             "ZONE_DN": forestzone_dn,
             "ZONE_GUID": forestzone_guid,