diff options
author | Andrew Bartlett <abartlet@samba.org> | 2017-03-14 13:39:00 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-03-28 09:23:11 +0200 |
commit | e77c18019aef9c98caa0b66cb2e9da5a6f58e600 (patch) | |
tree | ee9146a47464a69d75c48efa2628b515f9229541 /source4/lib | |
parent | 3bd9e5f4ed2362f5006144433295cde2276272c5 (diff) | |
download | samba-e77c18019aef9c98caa0b66cb2e9da5a6f58e600.tar.gz |
pymessaging: Add irpc_remove_name
This allows tests to be indirectly added for server_id_db_lookup()
and server_id_db_prune_name()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12705
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/messaging/pymessaging.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c index 5c20c186faf..5b5408caddb 100644 --- a/source4/lib/messaging/pymessaging.c +++ b/source4/lib/messaging/pymessaging.c @@ -260,6 +260,20 @@ static PyObject *py_irpc_add_name(PyObject *self, PyObject *args, PyObject *kwar Py_RETURN_NONE; } +static PyObject *py_irpc_remove_name(PyObject *self, PyObject *args, PyObject *kwargs) +{ + imessaging_Object *iface = (imessaging_Object *)self; + char *server_name; + + if (!PyArg_ParseTuple(args, "s", &server_name)) { + return NULL; + } + + irpc_remove_name(iface->msg_ctx, server_name); + + Py_RETURN_NONE; +} + static PyObject *py_irpc_servers_byname(PyObject *self, PyObject *args, PyObject *kwargs) { imessaging_Object *iface = (imessaging_Object *)self; @@ -364,6 +378,10 @@ static PyMethodDef py_imessaging_methods[] = { "S.irpc_add_name(name) -> None\n" "Add this context to the list of server_id values that " "are registered for a particular name" }, + { "irpc_remove_name", (PyCFunction)py_irpc_remove_name, METH_VARARGS, + "S.irpc_remove_name(name) -> None\n" + "Remove this context from the list of server_id values that " + "are registered for a particular name" }, { "irpc_servers_byname", (PyCFunction)py_irpc_servers_byname, METH_VARARGS, "S.irpc_servers_byname(name) -> list\nGet list of server_id values that are registered for a particular name" }, { "irpc_all_servers", (PyCFunction)py_irpc_all_servers, METH_NOARGS, |