Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
b6adc92b
Commit
b6adc92b
authored
Mar 11, 2013
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python: Add get_version to binding
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
b6b918a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
lxc.c
src/python-lxc/lxc.c
+8
-0
__init__.py
src/python-lxc/lxc/__init__.py
+1
-0
No files found.
src/python-lxc/lxc.c
View file @
b6adc92b
...
@@ -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
}
};
};
...
...
src/python-lxc/lxc/__init__.py
View file @
b6adc92b
...
@@ -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
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment