[lxc-devel] [PATCH 3/7] python3: Add reboot() to the binding
Serge Hallyn
serge.hallyn at ubuntu.com
Wed Nov 27 22:34:29 UTC 2013
Quoting Stéphane Graber (stgraber at ubuntu.com):
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> ---
> src/python-lxc/lxc.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/src/python-lxc/lxc.c b/src/python-lxc/lxc.c
> index 05fbff8..0604ec7 100644
> --- a/src/python-lxc/lxc.c
> +++ b/src/python-lxc/lxc.c
> @@ -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"
> --
> 1.8.4.4
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
More information about the lxc-devel
mailing list