summaryrefslogtreecommitdiff
path: root/source4/scripting/bin
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/scripting/bin
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/scripting/bin')
-rwxr-xr-xsource4/scripting/bin/upgradeprovision13
1 files changed, 3 insertions, 10 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
index 297d38addf..ff15dc5f55 100755
--- a/source4/scripting/bin/upgradeprovision
+++ b/source4/scripting/bin/upgradeprovision
@@ -44,7 +44,7 @@ from ldb import (SCOPE_SUBTREE, SCOPE_BASE,
FLAG_MOD_REPLACE, FLAG_MOD_ADD, FLAG_MOD_DELETE,
MessageElement, Message, Dn)
from samba import param, dsdb, Ldb
-from samba.provision import (find_setup_dir, get_domain_descriptor,
+from samba.provision import (get_domain_descriptor,
get_config_descriptor,
ProvisioningError, get_last_provision_usn,
get_max_usn, update_provision_usn)
@@ -182,9 +182,6 @@ smbconf = lp.configfile
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()
@@ -1442,9 +1439,6 @@ def sync_calculated_attributes(samdb, names):
increment_calculated_keyversion_number(samdb, names.rootdn,
hash["msDs-KeyVersionNumber"])
-def setup_path(file):
- return os.path.join(setup_dir, file)
-
# Synopsis for updateprovision
# 1) get path related to provision to be update (called current)
# 2) open current provision ldbs
@@ -1586,7 +1580,6 @@ if __name__ == '__main__':
# From here start the big steps of the program
# 1) First get files paths
paths = get_paths(param, smbconf=smbconf)
- paths.setup = setup_dir
# Get ldbs with the system session, it is needed for searching
# provision parameters
session = system_session()
@@ -1631,7 +1624,7 @@ if __name__ == '__main__':
message(SIMPLE, "Creating a reference provision")
provisiondir = tempfile.mkdtemp(dir=paths.private_dir,
prefix="referenceprovision")
- newprovision(names, setup_dir, creds, session, smbconf, provisiondir,
+ newprovision(names, creds, session, smbconf, provisiondir,
provision_logger)
# TODO
@@ -1680,7 +1673,7 @@ if __name__ == '__main__':
new_ldbs.startTransactions()
# 12)
- schema = Schema(setup_path, names.domainsid, schemadn=str(names.schemadn))
+ schema = Schema(names.domainsid, schemadn=str(names.schemadn))
# We create a closure that will be invoked just before schema reload
def schemareloadclosure():
basesam = Ldb(paths.samdb, session_info=session, credentials=creds, lp=lp,