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
d63b7ba4
Commit
d63b7ba4
authored
May 25, 2014
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python3: Handle invalid global config keys
Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
3a491345
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
lxc.c
src/python-lxc/lxc.c
+9
-1
No files found.
src/python-lxc/lxc.c
View file @
d63b7ba4
...
@@ -329,12 +329,20 @@ LXC_get_global_config_item(PyObject *self, PyObject *args, PyObject *kwds)
...
@@ -329,12 +329,20 @@ LXC_get_global_config_item(PyObject *self, PyObject *args, PyObject *kwds)
{
{
static
char
*
kwlist
[]
=
{
"key"
,
NULL
};
static
char
*
kwlist
[]
=
{
"key"
,
NULL
};
char
*
key
=
NULL
;
char
*
key
=
NULL
;
const
char
*
value
=
NULL
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"s|"
,
kwlist
,
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"s|"
,
kwlist
,
&
key
))
&
key
))
return
NULL
;
return
NULL
;
return
PyUnicode_FromString
(
lxc_get_global_config_item
(
key
));
value
=
lxc_get_global_config_item
(
key
);
if
(
!
value
)
{
PyErr_SetString
(
PyExc_KeyError
,
"Invalid configuration key"
);
return
NULL
;
}
return
PyUnicode_FromString
(
value
);
}
}
static
PyObject
*
static
PyObject
*
...
...
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