Commit 02cfe84c by Stéphane Graber

python3: Add reboot() to the binding

parent d7de719c
......@@ -598,6 +598,16 @@ Container_load_config(Container *self, PyObject *args, PyObject *kwds)
}
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)
{
static char *kwlist[] = {"path", NULL};
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment