diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-09-05 11:07:39 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-09-05 11:25:38 +1000 |
commit | 3d05a0856fd44bbd6c7bd88ce407eb0098f6f94c (patch) | |
tree | f4f4f185b9d508af5179bc22e159faaa8a546778 /source4/scripting | |
parent | 5c8bf1434dd2b68a635b9a273ecf2efba0127cea (diff) | |
download | samba-3d05a0856fd44bbd6c7bd88ce407eb0098f6f94c.tar.gz samba-3d05a0856fd44bbd6c7bd88ce407eb0098f6f94c.tar.bz2 samba-3d05a0856fd44bbd6c7bd88ce407eb0098f6f94c.zip |
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
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/upgrade.py | 10 |
1 files changed, 5 insertions, 5 deletions
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") |