diff options
author | John Mulligan <jmulligan@redhat.com> | 2022-04-24 10:25:50 -0400 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2022-05-06 17:16:30 +0000 |
commit | 7e4bc41983a8660f1d16c14ba60d9f3c26e9fc60 (patch) | |
tree | a4b74c7716dceee56155f4e79e92c1c85a987e65 /lib/smbconf | |
parent | 35df07d5ca639d6ee39903976ed0c329d3bfd4ec (diff) | |
download | samba-7e4bc41983a8660f1d16c14ba60d9f3c26e9fc60.tar.gz |
lib/smbconf: add delete_share method to SMBConf
Add a delete_share method wrapping smbconf_delete_share.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'lib/smbconf')
-rw-r--r-- | lib/smbconf/pysmbconf.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/smbconf/pysmbconf.c b/lib/smbconf/pysmbconf.c index d800e0134c4..bc4035a4468 100644 --- a/lib/smbconf/pysmbconf.c +++ b/lib/smbconf/pysmbconf.c @@ -347,6 +347,23 @@ static PyObject *obj_set_global_parameter(py_SMBConf_Object * self, Py_RETURN_NONE; } +static PyObject *obj_delete_share(py_SMBConf_Object * self, PyObject * args) +{ + sbcErr err; + char *servicename = NULL; + + if (!PyArg_ParseTuple(args, "s", &servicename)) { + return NULL; + } + + err = smbconf_delete_share(self->conf_ctx, servicename); + if (err != SBC_ERR_OK) { + py_raise_SMBConfError(err); + return NULL; + } + Py_RETURN_NONE; +} + PyDoc_STRVAR(obj_requires_messaging_doc, "requires_messaging() -> bool\n" "\n" @@ -396,6 +413,10 @@ PyDoc_STRVAR(obj_set_global_parameter_doc, "Set a global configuration parmeter. Specify the parameter name\n" "and parameter value.\n"); +PyDoc_STRVAR(obj_delete_share_doc, +"delete_share(str) -> None\n" +"Delete a service from the configuration.\n"); + static PyMethodDef py_smbconf_obj_methods[] = { { "requires_messaging", (PyCFunction) obj_requires_messaging, METH_NOARGS, obj_requires_messaging_doc }, @@ -415,6 +436,8 @@ static PyMethodDef py_smbconf_obj_methods[] = { obj_set_parameter_doc }, { "set_global_parameter", (PyCFunction) obj_set_global_parameter, METH_VARARGS, obj_set_global_parameter_doc }, + { "delete_share", (PyCFunction) obj_delete_share, METH_VARARGS, + obj_delete_share_doc }, { 0 }, }; |