Commit b6adc92b by Stéphane Graber

python: Add get_version to binding

parent b6b918a1
...@@ -101,6 +101,12 @@ get_default_config_path(Container *self, PyObject *args, PyObject *kwds) ...@@ -101,6 +101,12 @@ get_default_config_path(Container *self, PyObject *args, PyObject *kwds)
return PyUnicode_FromString(lxc_get_default_config_path()); 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 // Container properties
static PyObject * static PyObject *
Container_config_file_name(Container *self, PyObject *args, PyObject *kwds) Container_config_file_name(Container *self, PyObject *args, PyObject *kwds)
...@@ -637,6 +643,8 @@ PyVarObject_HEAD_INIT(NULL, 0) ...@@ -637,6 +643,8 @@ PyVarObject_HEAD_INIT(NULL, 0)
static PyMethodDef LXC_methods[] = { static PyMethodDef LXC_methods[] = {
{"get_default_config_path", (PyCFunction)get_default_config_path, METH_NOARGS, {"get_default_config_path", (PyCFunction)get_default_config_path, METH_NOARGS,
"Returns the current LXC config path"}, "Returns the current LXC config path"},
{"get_version", (PyCFunction)get_version, METH_NOARGS,
"Returns the current LXC library version"},
{NULL, NULL, 0, NULL} {NULL, NULL, 0, NULL}
}; };
......
...@@ -33,6 +33,7 @@ warnings.warn("The python-lxc API isn't yet stable " ...@@ -33,6 +33,7 @@ warnings.warn("The python-lxc API isn't yet stable "
"and may change at any point in the future.", Warning, 2) "and may change at any point in the future.", Warning, 2)
default_config_path = _lxc.get_default_config_path() default_config_path = _lxc.get_default_config_path()
version = _lxc.get_version()
class ContainerNetwork(): class ContainerNetwork():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment