summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2011-10-15 13:54:45 +0200
committerKai Blin <kai@samba.org>2011-10-17 09:51:12 +0200
commit8c076862ad0b1b14bb6addef323c5678368051af (patch)
tree279f533395f179f903c49ae3e92739c184f986d5
parentd58f266d19750484b72ad0e18de3e83c88e81169 (diff)
downloadsamba-8c076862ad0b1b14bb6addef323c5678368051af.tar.gz
samba-8c076862ad0b1b14bb6addef323c5678368051af.tar.bz2
samba-8c076862ad0b1b14bb6addef323c5678368051af.zip
s4 provision: DNS backend should be set by caller
Autobuild-User: Kai Blin <kai@samba.org> Autobuild-Date: Mon Oct 17 09:51:12 CEST 2011 on sn-devel-104
-rw-r--r--source4/scripting/python/samba/join.py6
-rw-r--r--source4/scripting/python/samba/provision/__init__.py4
-rw-r--r--source4/scripting/python/samba/upgrade.py8
-rwxr-xr-xsource4/scripting/python/samba/upgradehelpers.py3
4 files changed, 13 insertions, 8 deletions
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py
index 731f0b501b..6a8ac97f1c 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -584,7 +584,8 @@ class dc_join(object):
serverdn=ctx.server_dn, domain=ctx.domain_name,
hostname=ctx.myname, domainsid=ctx.domsid,
machinepass=ctx.acct_pass, serverrole="domain controller",
- sitename=ctx.site, lp=ctx.lp, ntdsguid=ctx.ntds_guid)
+ sitename=ctx.site, lp=ctx.lp, ntdsguid=ctx.ntds_guid,
+ dns_backend="NONE")
print "Provision OK for domain DN %s" % presult.domaindn
ctx.local_samdb = presult.samdb
ctx.lp = presult.lp
@@ -622,7 +623,8 @@ class dc_join(object):
domainguid=domguid,
targetdir=ctx.targetdir, samdb_fill=FILL_SUBDOMAIN,
machinepass=ctx.acct_pass, serverrole="domain controller",
- lp=ctx.lp, hostip=ctx.names.hostip, hostip6=ctx.names.hostip6)
+ lp=ctx.lp, hostip=ctx.names.hostip, hostip6=ctx.names.hostip6,
+ dns_backend="BIND9_FLATFILE")
print("Provision OK for domain %s" % ctx.names.dnsdomain)
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index 6594e39cb3..5e7e374ab9 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -1625,10 +1625,6 @@ def provision_fill(samdb, secrets_ldb, logger, names, paths,
dnsdomain=names.dnsdomain,
dns_keytab_path=paths.dns_keytab, dnspass=dnspass)
- # Default DNS backend is BIND9_FLATFILE using txt files for zone information
- if not dns_backend:
- dns_backend = "BIND9_FLATFILE"
-
setup_ad_dns(samdb, names, logger, hostip=hostip, hostip6=hostip6,
dns_backend=dns_backend, os_level=dom_for_fun_level)
diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py
index b41ab77eb2..07cb720f88 100644
--- a/source4/scripting/python/samba/upgrade.py
+++ b/source4/scripting/python/samba/upgrade.py
@@ -621,14 +621,20 @@ Please fix this account before attempting to upgrade again
logger.error(" %s" % str(sid))
raise ProvisioningError("Please remove duplicate sid entries before upgrade.")
+ if serverrole == "domain controller":
+ dns_backend = "BIND9_FLATFILE"
+ else:
+ dns_backend = "NONE"
+
# Do full provision
result = provision(logger, session_info, None,
targetdir=targetdir, realm=realm, domain=domainname,
domainsid=str(domainsid), next_rid=next_rid,
dc_rid=machinerid,
+ dom_for_fun_level=dsdb.DS_DOMAIN_FUNCTION_2003,
hostname=netbiosname, machinepass=machinepass,
serverrole=serverrole, samdb_fill=FILL_FULL,
- useeadb=useeadb)
+ useeadb=useeadb, dns_backend=dns_backend)
# Import WINS database
logger.info("Importing WINS database")
diff --git a/source4/scripting/python/samba/upgradehelpers.py b/source4/scripting/python/samba/upgradehelpers.py
index 9034140195..043f629ce5 100755
--- a/source4/scripting/python/samba/upgradehelpers.py
+++ b/source4/scripting/python/samba/upgradehelpers.py
@@ -256,6 +256,7 @@ def newprovision(names, creds, session, smbconf, provdir, logger):
shutil.rmtree(provdir)
os.mkdir(provdir)
logger.info("Provision stored in %s", provdir)
+ dns_backend="BIND9_FLATFILE"
provision(logger, session, creds, smbconf=smbconf,
targetdir=provdir, samdb_fill=FILL_FULL, realm=names.realm,
domain=names.domain, domainguid=names.domainguid,
@@ -268,7 +269,7 @@ def newprovision(names, creds, session, smbconf, provdir, logger):
serverrole="domain controller", ldap_backend_extra_port=None,
backend_type=None, ldapadminpass=None, ol_mmr_urls=None,
slapd_path=None, setup_ds_path=None, nosync=None,
- dom_for_fun_level=names.domainlevel,
+ dom_for_fun_level=names.domainlevel, dns_backend=dns_backend,
ldap_dryrun_mode=None, useeadb=True)