summaryrefslogtreecommitdiff
path: root/source4/param/pyparam.c
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/param/pyparam.c
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/param/pyparam.c')
-rw-r--r--source4/param/pyparam.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c
index fb7ff88cfc..bf4d1d0cbc 100644
--- a/source4/param/pyparam.c
+++ b/source4/param/pyparam.c
@@ -22,6 +22,7 @@
#include "param/param.h"
#include "param/loadparm.h"
#include "lib/talloc/pytalloc.h"
+#include "dynconfig/dynconfig.h"
/* There's no Py_ssize_t in 2.4, apparently */
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5
@@ -419,9 +420,16 @@ static PyObject *py_default_path(PyObject *self)
return PyString_FromString(lp_default_path());
}
+static PyObject *py_setup_dir(PyObject *self)
+{
+ return PyString_FromString(dyn_SETUPDIR);
+}
+
static PyMethodDef pyparam_methods[] = {
{ "default_path", (PyCFunction)py_default_path, METH_NOARGS,
"Returns the default smb.conf path." },
+ { "setup_dir", (PyCFunction)py_setup_dir, METH_NOARGS,
+ "Returns the compiled in location of provision tempates." },
{ NULL }
};