diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-04-14 19:01:32 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-04-14 19:01:32 +0200 |
commit | c1d9167fbcc5df9da4f603084ad732915c68c0c0 (patch) | |
tree | 0d9f90d2505ff977e07d19973fb7972000c68c30 | |
parent | 02f3695897dddb013fc1268a4f1a852cd4a3465e (diff) | |
download | samba-c1d9167fbcc5df9da4f603084ad732915c68c0c0.tar.gz samba-c1d9167fbcc5df9da4f603084ad732915c68c0c0.tar.bz2 samba-c1d9167fbcc5df9da4f603084ad732915c68c0c0.zip |
Also look in the environment for smb.conf path.
(This used to be commit 8be7d93735a357a3b73a1c4413d6fd9ec09b7555)
-rw-r--r-- | source4/scripting/python/samba/getopt.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py index 82cb004b62..7ec684a9d6 100644 --- a/source4/scripting/python/samba/getopt.py +++ b/source4/scripting/python/samba/getopt.py @@ -35,12 +35,14 @@ class SambaOptions(optparse.OptionGroup): self._configfile = arg def get_loadparm(self): - import param + import os, param lp = param.LoadParm() - if self._configfile is None: - lp.load_default() - else: + if self._configfile is not None: lp.load(self._configfile) + elif os.getenv("SMB_CONF_PATH") is not None: + lp.load(os.getenv("SMB_CONF_PATH")) + else: + lp.load_default() return lp class VersionOptions(optparse.OptionGroup): |