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
d1dd9113
Commit
d1dd9113
authored
Mar 10, 2015
by
Bieiaievskyi Sergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bdevtype to lxc create procedure
Signed-off-by: Bieliaievskyi Sergey magelan09@gmail.com
parent
3b6aebce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
19 deletions
+16
-19
lxc.c
src/python-lxc/lxc.c
+5
-5
__init__.py
src/python-lxc/lxc/__init__.py
+11
-14
No files found.
src/python-lxc/lxc.c
View file @
d1dd9113
...
...
@@ -801,11 +801,11 @@ Container_create(Container *self, PyObject *args, PyObject *kwds)
char
**
create_args
=
{
NULL
};
PyObject
*
retval
=
NULL
;
PyObject
*
vargs
=
NULL
;
char
*
bdevtype
=
NULL
;
int
i
=
0
;
static
char
*
kwlist
[]
=
{
"template"
,
"flags"
,
"args"
,
NULL
};
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"|siO"
,
kwlist
,
&
template_name
,
&
flags
,
&
vargs
))
static
char
*
kwlist
[]
=
{
"template"
,
"flags"
,
"bdevtype"
,
"args"
,
NULL
};
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"|sisO"
,
kwlist
,
&
template_name
,
&
flags
,
&
bdevtype
,
&
vargs
))
return
NULL
;
if
(
vargs
)
{
...
...
@@ -821,7 +821,7 @@ Container_create(Container *self, PyObject *args, PyObject *kwds)
}
}
if
(
self
->
container
->
create
(
self
->
container
,
template_name
,
NULL
,
NULL
,
if
(
self
->
container
->
create
(
self
->
container
,
template_name
,
bdevtype
,
NULL
,
flags
,
create_args
))
retval
=
Py_True
;
else
...
...
src/python-lxc/lxc/__init__.py
View file @
d1dd9113
...
...
@@ -205,7 +205,7 @@ class Container(_lxc.Container):
return
_lxc
.
Container
.
set_config_item
(
self
,
key
,
value
)
def
create
(
self
,
template
=
None
,
flags
=
0
,
args
=
()):
def
create
(
self
,
template
=
None
,
flags
=
0
,
args
=
()
,
bdevtype
=
None
):
"""
Create a new rootfs for the container.
...
...
@@ -217,22 +217,19 @@ class Container(_lxc.Container):
"args" (optional) is a tuple of arguments to pass to the
template. It can also be provided as a dict.
"""
if
isinstance
(
args
,
dict
):
t
emplate
_args
=
[]
t
mp
_args
=
[]
for
item
in
args
.
items
():
template_args
.
append
(
"--
%
s"
%
item
[
0
])
template_args
.
append
(
"
%
s"
%
item
[
1
])
else
:
template_args
=
args
tmp_args
.
append
(
"--
%
s"
%
item
[
0
])
tmp_args
.
append
(
"
%
s"
%
item
[
1
])
template_args
=
{}
if
template
:
return
_lxc
.
Container
.
create
(
self
,
template
=
template
,
flags
=
flags
,
args
=
tuple
(
template_args
)
)
els
e
:
return
_lxc
.
Container
.
create
(
self
,
flags
=
flags
,
args
=
tuple
(
template_args
)
)
template_args
[
'template'
]
=
template
template_args
[
'flags'
]
=
flags
template_args
[
'args'
]
=
tuple
(
tmp_args
)
if
bdevtyp
e
:
template_args
[
'bdevtype'
]
=
bdevtype
return
_lxc
.
Container
.
create
(
self
,
**
template_args
)
def
clone
(
self
,
newname
,
config_path
=
None
,
flags
=
0
,
bdevtype
=
None
,
bdevdata
=
None
,
newsize
=
0
,
hookargs
=
()):
...
...
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