Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
storagedriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3e753504
authored
Oct 06, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network config for ci
parent
6b3d5ad3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
disk.py
+6
-2
storagedriver.py
+2
-2
No files found.
disk.py
View file @
3e753504
...
@@ -193,23 +193,27 @@ class Disk(object):
...
@@ -193,23 +193,27 @@ class Disk(object):
return
True
return
True
return
False
return
False
def
create_ci_disk
(
self
,
meta_data
,
user_data
):
def
create_ci_disk
(
self
,
meta_data
,
user_data
,
network_data
):
tmp_dir
=
self
.
dir
+
'/dir'
+
self
.
name
tmp_dir
=
self
.
dir
+
'/dir'
+
self
.
name
os
.
mkdir
(
tmp_dir
)
os
.
mkdir
(
tmp_dir
)
meta_path
=
tmp_dir
+
'/meta-data'
meta_path
=
tmp_dir
+
'/meta-data'
user_path
=
tmp_dir
+
'/user-data'
user_path
=
tmp_dir
+
'/user-data'
net_path
=
tmp_dir
+
'/network-config'
with
open
(
meta_path
,
'w'
)
as
f
:
with
open
(
meta_path
,
'w'
)
as
f
:
f
.
write
(
meta_data
)
f
.
write
(
meta_data
)
with
open
(
user_path
,
'w'
)
as
f
:
with
open
(
user_path
,
'w'
)
as
f
:
f
.
write
(
user_data
)
f
.
write
(
user_data
)
with
open
(
net_path
,
'w'
)
as
f
:
f
.
write
(
network_data
)
cmdline
=
[
'genisoimage'
,
cmdline
=
[
'genisoimage'
,
'-output'
,
self
.
get_path
(),
'-output'
,
self
.
get_path
(),
'-V'
,
'cidata'
,
'-r'
,
'-J'
,
'-V'
,
'cidata'
,
'-r'
,
'-J'
,
meta_path
,
meta_path
,
user_path
]
user_path
,
net_path
]
subprocess
.
check_output
(
cmdline
)
subprocess
.
check_output
(
cmdline
)
os
.
remove
(
meta_path
)
os
.
remove
(
meta_path
)
os
.
remove
(
user_path
)
os
.
remove
(
user_path
)
os
.
remove
(
net_path
)
os
.
removedirs
(
tmp_dir
)
os
.
removedirs
(
tmp_dir
)
self
.
size
=
Disk
.
get
(
self
.
dir
,
self
.
name
)
.
size
self
.
size
=
Disk
.
get
(
self
.
dir
,
self
.
name
)
.
size
...
...
storagedriver.py
View file @
3e753504
...
@@ -29,9 +29,9 @@ def create(disk_desc):
...
@@ -29,9 +29,9 @@ def create(disk_desc):
@celery.task
()
@celery.task
()
def
create_ci_disk
(
disk_desc
,
meta_data
,
user_data
):
def
create_ci_disk
(
disk_desc
,
meta_data
,
user_data
,
network_data
):
disk
=
Disk
.
deserialize
(
disk_desc
)
disk
=
Disk
.
deserialize
(
disk_desc
)
disk
.
create_ci_disk
(
meta_data
=
meta_data
,
user_data
=
user_data
)
disk
.
create_ci_disk
(
meta_data
=
meta_data
,
user_data
=
user_data
,
network_data
=
network_data
)
return
{
'size'
:
disk
.
size
,
return
{
'size'
:
disk
.
size
,
'type'
:
'raw-ro'
,
'type'
:
'raw-ro'
,
'checksum'
:
disk
.
checksum
,
}
'checksum'
:
disk
.
checksum
,
}
...
...
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