diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-01-25 09:36:47 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-01-27 20:14:22 +1100 |
commit | 58d6d884cf8a8de5a1fa2dfd4a0cbacdff0d2483 (patch) | |
tree | 60243347d4c7a96a5c0f3c42d20b2d6af44f0360 /source4/scripting | |
parent | b855df254de40d9de0b7f9042564f6d521ab1c5d (diff) | |
download | samba-58d6d884cf8a8de5a1fa2dfd4a0cbacdff0d2483.tar.gz samba-58d6d884cf8a8de5a1fa2dfd4a0cbacdff0d2483.tar.bz2 samba-58d6d884cf8a8de5a1fa2dfd4a0cbacdff0d2483.zip |
samba_upgradeprovision: detect dns_backend for the reference provision
If we have a DomainDnsZone partition, we use BIND9_DLZ as backend
and fix errors in the ForestDnsZone and DomainDnsZone partitions.
Note: this should work fine also for SAMBA_INTERNAL.
If the current setup doesn't use dns specific partitions (e.g. alpha13 setups)
we pass dns_backend=BIND9_FLATFILE.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting')
-rwxr-xr-x | source4/scripting/bin/samba_upgradeprovision | 18 | ||||
-rw-r--r-- | source4/scripting/python/samba/upgradehelpers.py | 3 |
2 files changed, 11 insertions, 10 deletions
diff --git a/source4/scripting/bin/samba_upgradeprovision b/source4/scripting/bin/samba_upgradeprovision index 883fc9a8c6..e2c57f2998 100755 --- a/source4/scripting/bin/samba_upgradeprovision +++ b/source4/scripting/bin/samba_upgradeprovision @@ -228,7 +228,7 @@ creds.set_kerberos_state(DONT_USE_KERBEROS) -def check_for_DNS(refprivate, private): +def check_for_DNS(refprivate, private, dns_backend): """Check if the provision has already the requirement for dynamic dns :param refprivate: The path to the private directory of the reference @@ -238,10 +238,6 @@ def check_for_DNS(refprivate, private): spnfile = "%s/spn_update_list" % private dnsfile = "%s/dns_update_list" % private - namedfile = lp.get("dnsupdate:path") - - if not namedfile: - namedfile = "%s/named.conf.update" % private if not os.path.exists(spnfile): shutil.copy("%s/spn_update_list" % refprivate, "%s" % spnfile) @@ -249,10 +245,16 @@ def check_for_DNS(refprivate, private): if not os.path.exists(dnsfile): shutil.copy("%s/dns_update_list" % refprivate, "%s" % dnsfile) - destdir = "%s/new_dns" % private - dnsdir = "%s/dns" % private + if dns_backend not in ['BIND9_DLZ', 'BIND9_FLATFILE']: + return + namedfile = lp.get("dnsupdate:path") + if not namedfile: + namedfile = "%s/named.conf.update" % private if not os.path.exists(namedfile): + destdir = "%s/new_dns" % private + dnsdir = "%s/dns" % private + if not os.path.exists(destdir): os.mkdir(destdir) if not os.path.exists(dnsdir): @@ -1964,7 +1966,7 @@ if __name__ == '__main__': # 20) updateOEMInfo(ldbs.sam, str(names.rootdn)) # 21) - check_for_DNS(newpaths.private_dir, paths.private_dir) + check_for_DNS(newpaths.private_dir, paths.private_dir, names.dns_backend) # 22) if lastProvisionUSNs is not None: update_provision_usn(ldbs.sam, minUSN, maxUSN, names.invocation) diff --git a/source4/scripting/python/samba/upgradehelpers.py b/source4/scripting/python/samba/upgradehelpers.py index 81fb8dc0f4..8427f6ae37 100644 --- a/source4/scripting/python/samba/upgradehelpers.py +++ b/source4/scripting/python/samba/upgradehelpers.py @@ -242,7 +242,6 @@ def newprovision(names, creds, session, smbconf, provdir, logger): shutil.rmtree(provdir) os.mkdir(provdir) logger.info("Provision stored in %s", provdir) - dns_backend="BIND9_DLZ" return provision(logger, session, creds, smbconf=smbconf, targetdir=provdir, samdb_fill=FILL_FULL, realm=names.realm, domain=names.domain, domainguid=names.domainguid, @@ -255,7 +254,7 @@ def newprovision(names, creds, session, smbconf, provdir, logger): serverrole="domain controller", backend_type=None, ldapadminpass=None, ol_mmr_urls=None, slapd_path=None, - dom_for_fun_level=names.domainlevel, dns_backend=dns_backend, + dom_for_fun_level=names.domainlevel, dns_backend=names.dns_backend, useeadb=True, use_ntvfs=True) |