From 3d05a0856fd44bbd6c7bd88ce407eb0098f6f94c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 5 Sep 2011 11:07:39 +1000 Subject: s4-provision Use ProvisioningError and the eadb The eadb flag tells us to avoid using system extended attributes, typcially if we are not running as root (ie, in a test environment). The ProvisioningError class allows us to return failures to the upgrade_from_s3 script which can then be detected correctly by the selftest framework. Andrew Bartlett --- source4/scripting/python/samba/upgrade.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/scripting') diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py index 09a66dbf13..aaadb6a418 100644 --- a/source4/scripting/python/samba/upgrade.py +++ b/source4/scripting/python/samba/upgrade.py @@ -26,7 +26,7 @@ import pwd from samba import Ldb, registry from samba.param import LoadParm -from samba.provision import provision, FILL_FULL +from samba.provision import provision, FILL_FULL, ProvisioningError from samba.samba3 import passdb from samba.samba3 import param as s3param from samba.dcerpc import lsa @@ -414,7 +414,7 @@ def import_registry(samba4_registry, samba3_regdb): key_handle.set_value(value_name, value_type, value_data) -def upgrade_from_samba3(samba3, logger, targetdir, session_info=None): +def upgrade_from_samba3(samba3, logger, targetdir, session_info=None, useeadb=False): """Upgrade from samba3 database to samba4 AD database :param samba3: samba3 object @@ -445,8 +445,7 @@ def upgrade_from_samba3(samba3, logger, targetdir, session_info=None): if not realm: if serverrole == "domain controller": - logger.warning("No realm specified in smb.conf file and being a DC. That upgrade path doesn't work! Please add a 'realm' directive to your old smb.conf to let us know which one you want to use (generally it's the upcased DNS domainname).") - return + raise ProvisioningError("No realm specified in smb.conf file and being a DC. That upgrade path doesn't work! Please add a 'realm' directive to your old smb.conf to let us know which one you want to use (it is the DNS name of the AD domain you wish to create.") else: realm = domainname.upper() logger.warning("No realm specified in smb.conf file, assuming '%s'", @@ -554,7 +553,8 @@ def upgrade_from_samba3(samba3, logger, targetdir, session_info=None): domainsid=str(domainsid), next_rid=next_rid, dc_rid=machinerid, hostname=netbiosname, machinepass=machinepass, - serverrole=serverrole, samdb_fill=FILL_FULL) + serverrole=serverrole, samdb_fill=FILL_FULL, + useeadb=useeadb) # Import WINS database logger.info("Importing WINS database") -- cgit