Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

python: Add get_version to binding

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information...
commit b6adc92b5f40e4bcd72b1e6a3bd82fbb160257eb 1 parent b6b918a
@stgraber stgraber authored
Showing with 9 additions and 0 deletions.
  1. +8 −0 src/python-lxc/lxc.c
  2. +1 −0  src/python-lxc/lxc/__init__.py
View
8 src/python-lxc/lxc.c
@@ -101,6 +101,12 @@ get_default_config_path(Container *self, PyObject *args, PyObject *kwds)
return PyUnicode_FromString(lxc_get_default_config_path());
}
+static PyObject *
+get_version(Container *self, PyObject *args, PyObject *kwds)
+{
+ return PyUnicode_FromString(lxc_get_version());
+}
+
// Container properties
static PyObject *
Container_config_file_name(Container *self, PyObject *args, PyObject *kwds)
@@ -637,6 +643,8 @@ PyVarObject_HEAD_INIT(NULL, 0)
static PyMethodDef LXC_methods[] = {
{"get_default_config_path", (PyCFunction)get_default_config_path, METH_NOARGS,
"Returns the current LXC config path"},
+ {"get_version", (PyCFunction)get_version, METH_NOARGS,
+ "Returns the current LXC library version"},
{NULL, NULL, 0, NULL}
};
View
1  src/python-lxc/lxc/__init__.py
@@ -33,6 +33,7 @@
"and may change at any point in the future.", Warning, 2)
default_config_path = _lxc.get_default_config_path()
+version = _lxc.get_version()
class ContainerNetwork():
Please sign in to comment.
Something went wrong with that request. Please try again.