From: Stéphane Graber Date: Wed, 27 Nov 2013 18:31:05 +0000 (-0500) Subject: python3: Add reboot() to the binding X-Git-Tag: lxc-1.0.0.beta1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02cfe84c854157aff95cf04813c408b96da5fe34;p=thirdparty%2Flxc.git python3: Add reboot() to the binding Signed-off-by: Stéphane Graber Acked-by: Serge E. Hallyn --- diff --git a/src/python-lxc/lxc.c b/src/python-lxc/lxc.c index 05fbff8d5..0604ec7bf 100644 --- a/src/python-lxc/lxc.c +++ b/src/python-lxc/lxc.c @@ -597,6 +597,16 @@ Container_load_config(Container *self, PyObject *args, PyObject *kwds) Py_RETURN_FALSE; } +static PyObject * +Container_reboot(Container *self, PyObject *args, PyObject *kwds) +{ + if (self->container->reboot(self->container)) { + Py_RETURN_TRUE; + } + + Py_RETURN_FALSE; +} + static PyObject * Container_save_config(Container *self, PyObject *args, PyObject *kwds) { @@ -1195,6 +1205,12 @@ static PyMethodDef Container_methods[] = { "Read the container configuration from its default " "location or from an alternative location if provided." }, + {"reboot", (PyCFunction)Container_reboot, + METH_NOARGS, + "reboot() -> boolean\n" + "\n" + "Ask the container to reboot." + }, {"save_config", (PyCFunction)Container_save_config, METH_VARARGS|METH_KEYWORDS, "save_config(path = DEFAULT) -> boolean\n"