From: Stéphane Graber Date: Wed, 27 Nov 2013 18:49:03 +0000 (-0500) Subject: python3: Add controllable property to the binding X-Git-Tag: lxc-1.0.0.beta1~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de86840aa0aa1798f3281ed558e95a8958f35b86;p=thirdparty%2Flxc.git python3: Add controllable property 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 7c28607c2..43e571d9d 100644 --- a/src/python-lxc/lxc.c +++ b/src/python-lxc/lxc.c @@ -455,6 +455,16 @@ Container_config_file_name(Container *self, void *closure) self->container->config_file_name(self->container)); } +static PyObject * +Container_controllable(Container *self, void *closure) +{ + if (self->container->may_control(self->container)) { + Py_RETURN_TRUE; + } + + Py_RETURN_FALSE; +} + static PyObject * Container_defined(Container *self, void *closure) { @@ -1101,6 +1111,10 @@ static PyGetSetDef Container_getseters[] = { (getter)Container_config_file_name, NULL, "Path to the container configuration", NULL}, + {"controllable", + (getter)Container_controllable, NULL, + "Boolean indicating whether the container may be controlled", + NULL}, {"defined", (getter)Container_defined, NULL, "Boolean indicating whether the container configuration exists",