]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
python3: Add clear_config() to the binding
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 27 Nov 2013 18:46:43 +0000 (13:46 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 27 Nov 2013 22:44:57 +0000 (17:44 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/python-lxc/lxc.c

index 1ed8cbe92c36358c8f66582ecd18cbfe2bf3129e..7c28607c25457e2776c8356d1c27bf641c0466ba 100644 (file)
@@ -545,6 +545,14 @@ Container_attach_wait(Container *self, PyObject *args, PyObject *kwds)
     return Container_attach_and_possibly_wait(self, args, kwds, 1);
 }
 
+static PyObject *
+Container_clear_config(Container *self, PyObject *args, PyObject *kwds)
+{
+    self->container->clear_config(self->container);
+
+    Py_RETURN_NONE;
+}
+
 static PyObject *
 Container_clear_config_item(Container *self, PyObject *args, PyObject *kwds)
 {
@@ -1129,6 +1137,12 @@ static PyMethodDef Container_methods[] = {
      "\n"
      "Attach to the container. Returns the exit code of the process."
     },
+    {"clear_config", (PyCFunction)Container_clear_config,
+     METH_NOARGS,
+     "clear_config()\n"
+     "\n"
+     "Clear any container configuration."
+    },
     {"clear_config_item", (PyCFunction)Container_clear_config_item,
      METH_VARARGS|METH_KEYWORDS,
      "clear_config_item(key) -> boolean\n"