summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-25 01:41:06 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-25 01:41:06 +0100
commitdbf400c3da853e6845f0d0b667f713639b29582e (patch)
tree69ce5a9e5afe534e9f4ce5ff25607972f2117daa /source4/setup
parentc91791bbc489d90eca5f6b8d6dc369d7e2129c29 (diff)
downloadsamba-dbf400c3da853e6845f0d0b667f713639b29582e.tar.gz
samba-dbf400c3da853e6845f0d0b667f713639b29582e.tar.bz2
samba-dbf400c3da853e6845f0d0b667f713639b29582e.zip
python/provision: Create private dir if it didn't exist yet.
(This used to be commit 66df250ff355d3c1b7f0252fc1f95a8c79a28c6d)
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/provision.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/source4/setup/provision.py b/source4/setup/provision.py
index 743a94700d..c8087f7bd7 100755
--- a/source4/setup/provision.py
+++ b/source4/setup/provision.py
@@ -2,7 +2,8 @@
#
# Unix SMB/CIFS implementation.
# provision a Samba4 server
-# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
+# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008
+# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008
#
# Based on the original in EJS:
# Copyright (C) Andrew Tridgell 2005
@@ -115,11 +116,15 @@ if opts.realm is None or opts.domain is None:
sys.exit(1)
# cope with an initially blank smb.conf
+private_dir = None
lp = sambaopts.get_loadparm()
if opts.targetdir is not None:
if not os.path.exists(opts.targetdir):
os.mkdir(opts.targetdir)
- lp.set("private dir", os.path.abspath(opts.targetdir))
+ private_dir = os.path.join(opts.targetdir, "private")
+ if not os.path.exists(private_dir):
+ os.mkdir(private_dir)
+ lp.set("private dir", os.path.abspath(private_dir))
lp.set("lock dir", os.path.abspath(opts.targetdir))
lp.set("realm", opts.realm)
lp.set("workgroup", opts.domain)
@@ -129,9 +134,6 @@ lp.set("server role", opts.server_role or "domain controller")
if opts.aci is not None:
print "set ACI: %s" % opts.aci
-private_dir = None
-if opts.targetdir is not None:
- private_dir = os.path.join(opts.targetdir, "private")
paths = provision_paths_from_lp(lp, opts.realm.lower(), private_dir)
paths.smbconf = sambaopts.get_loadparm_path()
@@ -168,4 +170,4 @@ def shell_escape(arg):
return arg
message(" ".join([shell_escape(arg) for arg in sys.argv]))
-message("All OK") \ No newline at end of file
+message("All OK")