summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-02-05 10:34:51 +1100
committerAndrew Tridgell <tridge@samba.org>2011-02-07 13:22:01 +1100
commitd1e5a7380619043a351ba8a25ebb8031163e70b7 (patch)
treedfb73691356940c847265086d7100286f864b010 /source4/setup
parent4ae013c01b2936e7fd80e674a617f10b54179010 (diff)
downloadsamba-d1e5a7380619043a351ba8a25ebb8031163e70b7.tar.gz
samba-d1e5a7380619043a351ba8a25ebb8031163e70b7.tar.bz2
samba-d1e5a7380619043a351ba8a25ebb8031163e70b7.zip
s4-provision Remove setup_path, setup_dir and find_setup_dir
We now have a reliable way to know the current location of the templates: dyn_SETUPDIR, which is updated for both the in-build and installed binaries. This replaces the function arguments and the distributed resolution of the setup directory with one 'global' function (imported as required). This also removes the ability to specify an alternate setup directory on the command line, as this was rarely if ever used and never tested. Andrew Bartlett
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/provision10
-rwxr-xr-xsource4/setup/upgrade_from_s310
2 files changed, 3 insertions, 17 deletions
diff --git a/source4/setup/provision b/source4/setup/provision
index 18142addbf..1573b485d5 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -35,7 +35,7 @@ import samba.ntacls
from samba.credentials import DONT_USE_KERBEROS
from samba.auth import system_session
import samba.getopt as options
-from samba.provision import provision, FILL_FULL, FILL_NT4SYNC, FILL_DRS, find_setup_dir, ProvisioningError
+from samba.provision import provision, FILL_FULL, FILL_NT4SYNC, FILL_DRS, ProvisioningError
from samba.dsdb import (
DS_DOMAIN_FUNCTION_2000,
DS_DOMAIN_FUNCTION_2003,
@@ -52,8 +52,6 @@ parser.add_option_group(options.VersionOptions(parser))
credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
parser.add_option("--interactive", help="Ask for names", action="store_true")
-parser.add_option("--setupdir", type="string", metavar="DIR",
- help="directory with setup files")
parser.add_option("--domain", type="string", metavar="DOMAIN",
help="set domain")
parser.add_option("--domain-guid", type="string", metavar="GUID",
@@ -205,10 +203,6 @@ creds = credopts.get_credentials(lp)
creds.set_kerberos_state(DONT_USE_KERBEROS)
-setup_dir = opts.setupdir
-if setup_dir is None:
- setup_dir = find_setup_dir()
-
samdb_fill = FILL_FULL
if opts.blank:
samdb_fill = FILL_NT4SYNC
@@ -241,7 +235,7 @@ else:
session = system_session()
try:
- provision(setup_dir, logger,
+ provision(logger,
session, creds, smbconf=smbconf, targetdir=opts.targetdir,
samdb_fill=samdb_fill, realm=opts.realm, domain=opts.domain,
domainguid=opts.domain_guid, domainsid=opts.domain_sid,
diff --git a/source4/setup/upgrade_from_s3 b/source4/setup/upgrade_from_s3
index a7bc6f0abd..e0d4604b6e 100755
--- a/source4/setup/upgrade_from_s3
+++ b/source4/setup/upgrade_from_s3
@@ -26,18 +26,14 @@ sys.path.insert(0, "bin/python")
import samba
import samba.getopt as options
from samba.auth import system_session
-from samba.provision import find_setup_dir
from samba.upgrade import upgrade_provision
from samba.samba3 import Samba3
-
parser = optparse.OptionParser("upgrade_from_s3 [options] <libdir> <smbconf>")
sambaopts = options.SambaOptions(parser)
parser.add_option_group(sambaopts)
parser.add_option_group(options.VersionOptions(parser))
credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
-parser.add_option("--setupdir", type="string", metavar="DIR",
- help="directory with setup files")
parser.add_option("--quiet", help="Be quiet")
parser.add_option("--blank",
help="do not add users or groups, just the structure")
@@ -73,14 +69,10 @@ samba3 = Samba3(libdir, smbconf)
logger.info("Provisioning")
-setup_dir = opts.setupdir
-if setup_dir is None:
- setup_dir = find_setup_dir()
-
lp = sambaopts.get_loadparm()
smbconf = lp.configfile
creds = credopts.get_credentials(lp)
-upgrade_provision(samba3, setup_dir, logger, credentials=creds,
+upgrade_provision(samba3, logger, credentials=creds,
session_info=system_session(), smbconf=smbconf,
targetdir=opts.targetdir)