summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-27 17:20:51 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-28 07:57:29 +1000
commit85f1c4fdfdda7e9c765c6c4ab7f50519c657a409 (patch)
treef225ffa65e91b6b5ac0365bdac4c79e721bf52ba
parent738f4ac058ab49239271539fe66d09bfa81a138b (diff)
downloadsamba-85f1c4fdfdda7e9c765c6c4ab7f50519c657a409.tar.gz
samba-85f1c4fdfdda7e9c765c6c4ab7f50519c657a409.tar.bz2
samba-85f1c4fdfdda7e9c765c6c4ab7f50519c657a409.zip
s4-classicupgrade: Do all the queries of data before the provision()
This allows provision to change the s3 smb.conf settings if required. Andrew Bartlett
-rw-r--r--source4/scripting/python/samba/upgrade.py70
1 files changed, 35 insertions, 35 deletions
diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py
index 32d8326cf9..4d4b08a76c 100644
--- a/source4/scripting/python/samba/upgrade.py
+++ b/source4/scripting/python/samba/upgrade.py
@@ -769,41 +769,6 @@ Please fix this account before attempting to upgrade again
logger.error(" %s" % str(sid))
raise ProvisioningError("Please remove duplicate sid entries before upgrade.")
- if not (serverrole == "ROLE_DOMAIN_BDC" or serverrole == "ROLE_DOMAIN_PDC"):
- 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.lower(), machinepass=machinepass,
- serverrole=serverrole, samdb_fill=FILL_FULL,
- useeadb=useeadb, dns_backend=dns_backend, use_rfc2307=True,
- use_ntvfs=use_ntvfs)
- result.report_logger(logger)
-
- # Import WINS database
- logger.info("Importing WINS database")
-
- samba3_winsdb = None
- try:
- samba3_winsdb = samba3.get_wins_db()
- except IOError, e:
- logger.warn('Cannot open wins database, Ignoring: %s', str(e))
-
- if samba3_winsdb:
- import_wins(Ldb(result.paths.winsdb), samba3_winsdb)
-
- # Set Account policy
- logger.info("Importing Account policy")
- import_sam_policy(result.samdb, policy, logger)
-
- # Migrate IDMAP database
- logger.info("Importing idmap database")
- import_idmap(result.idmap, samba3, logger)
-
# Get posix attributes from ldap or the os
homes = {}
shells = {}
@@ -844,6 +809,41 @@ Please fix this account before attempting to upgrade again
except KeyError:
pass
+ if not (serverrole == "ROLE_DOMAIN_BDC" or serverrole == "ROLE_DOMAIN_PDC"):
+ 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.lower(), machinepass=machinepass,
+ serverrole=serverrole, samdb_fill=FILL_FULL,
+ useeadb=useeadb, dns_backend=dns_backend, use_rfc2307=True,
+ use_ntvfs=use_ntvfs)
+ result.report_logger(logger)
+
+ # Import WINS database
+ logger.info("Importing WINS database")
+
+ samba3_winsdb = None
+ try:
+ samba3_winsdb = samba3.get_wins_db()
+ except IOError, e:
+ logger.warn('Cannot open wins database, Ignoring: %s', str(e))
+
+ if samba3_winsdb:
+ import_wins(Ldb(result.paths.winsdb), samba3_winsdb)
+
+ # Set Account policy
+ logger.info("Importing Account policy")
+ import_sam_policy(result.samdb, policy, logger)
+
+ # Migrate IDMAP database
+ logger.info("Importing idmap database")
+ import_idmap(result.idmap, samba3, logger)
+
# Set the s3 context for samba4 configuration
new_lp_ctx = s3param.get_context()
new_lp_ctx.load(result.lp.configfile)