Skip to content

Commit

Permalink
python3: Add controllable property to the binding
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
stgraber committed Nov 27, 2013
1 parent 5d15c21 commit de86840
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/python-lxc/lxc.c
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit de86840

Please sign in to comment.