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
87d8dfe5
Commit
87d8dfe5
authored
Feb 13, 2014
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python3: Add missing get_running_config_item binding
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
6b9324bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
lxc.c
src/python-lxc/lxc.c
+30
-0
No files found.
src/python-lxc/lxc.c
View file @
87d8dfe5
...
...
@@ -1007,6 +1007,30 @@ Container_get_ips(Container *self, PyObject *args, PyObject *kwds)
}
static
PyObject
*
Container_get_running_config_item
(
Container
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
static
char
*
kwlist
[]
=
{
"key"
,
NULL
};
char
*
key
=
NULL
;
char
*
value
=
NULL
;
PyObject
*
ret
=
NULL
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"s|"
,
kwlist
,
&
key
))
return
NULL
;
value
=
self
->
container
->
get_running_config_item
(
self
->
container
,
key
);
if
(
!
value
)
Py_RETURN_NONE
;
ret
=
PyUnicode_FromString
(
value
);
free
(
value
);
return
ret
;
}
static
PyObject
*
Container_load_config
(
Container
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
static
char
*
kwlist
[]
=
{
"path"
,
NULL
};
...
...
@@ -1537,6 +1561,12 @@ static PyMethodDef Container_methods[] = {
"
\n
"
"Get a tuple of IPs for the container."
},
{
"get_running_config_item"
,
(
PyCFunction
)
Container_get_running_config_item
,
METH_VARARGS
|
METH_KEYWORDS
,
"get_running_config_item(key) -> string
\n
"
"
\n
"
"Get the runtime value of a config key."
},
{
"load_config"
,
(
PyCFunction
)
Container_load_config
,
METH_VARARGS
|
METH_KEYWORDS
,
"load_config(path = DEFAULT) -> boolean
\n
"
...
...
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