summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-01-16 15:05:15 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-01-16 15:05:15 +0100
commit673ca5145c9c120cdb522096fd625662407f6f3d (patch)
tree969bc18a9f8ce5bddbd5d90ad0be6fcab0c2b9c7 /source4/scripting/python
parent0d7ca8e89e37d1aa07a4c8fad6a24ac41ceb4855 (diff)
downloadsamba-673ca5145c9c120cdb522096fd625662407f6f3d.tar.gz
samba-673ca5145c9c120cdb522096fd625662407f6f3d.tar.bz2
samba-673ca5145c9c120cdb522096fd625662407f6f3d.zip
Find default smb.conf path correctly, when it was not specified on the
command-line.
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/provision.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 6becc78dc7..70bd8ac7f6 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -344,6 +344,9 @@ def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None, serverrole=
def make_smbconf(smbconf, setup_path, hostname, domain, realm, serverrole,
targetdir):
+ """Create a new smb.conf file based on a couple of basic settings.
+ """
+ assert smbconf is not None
if hostname is None:
hostname = socket.gethostname().split(".")[0].lower()
@@ -947,6 +950,8 @@ def provision(setup_dir, message, session_info,
if (not os.path.exists(os.path.join(targetdir, "etc"))):
os.makedirs(os.path.join(targetdir, "etc"))
smbconf = os.path.join(targetdir, "etc", "smb.conf")
+ elif smbconf is None:
+ smbconf = param.default_path()
# only install a new smb.conf if there isn't one there already
if not os.path.exists(smbconf):
@@ -1178,6 +1183,9 @@ def provision_backend(setup_dir=None, message=None,
if (not os.path.exists(os.path.join(targetdir, "etc"))):
os.makedirs(os.path.join(targetdir, "etc"))
smbconf = os.path.join(targetdir, "etc", "smb.conf")
+ elif smbconf is None:
+ smbconf = param.default_path()
+ assert smbconf is not None
# only install a new smb.conf if there isn't one there already
if not os.path.exists(smbconf):