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
20f8ce8f
authored
Jul 20, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci integraion init
parent
2ee7f788
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
disk.py
+17
-0
storagedriver.py
+6
-0
No files found.
disk.py
View file @
20f8ce8f
...
...
@@ -193,6 +193,23 @@ class Disk(object):
return
True
return
False
def
create_ci_disk
(
self
,
meta_data
,
user_data
):
disk_path
=
self
.
get_path
()
logger
.
info
(
"Create CI iso to
%
s"
,
disk_path
)
print
(
"Create CI iso to
%
s"
,
disk_path
)
with
open
(
self
.
dir
+
'/meta-data'
,
'w'
)
as
f
:
f
.
write
(
meta_data
)
with
open
(
self
.
dir
+
'/user-data'
,
'w'
)
as
f
:
f
.
write
(
user_data
)
cmdline
=
[
'genisoimage'
,
'-output'
,
self
.
get_path
(),
'-V'
,
'cidata'
,
'-r'
,
'-J'
,
self
.
dir
+
'/meta-data'
,
self
.
dir
+
'/user-data'
]
subprocess
.
check_output
(
cmdline
)
self
.
size
=
Disk
.
get
(
self
.
dir
,
self
.
name
)
.
size
def
download
(
self
,
task
,
url
,
parent_id
=
None
):
# noqa
"""Download image from url."""
disk_path
=
self
.
get_path
()
...
...
storagedriver.py
View file @
20f8ce8f
...
...
@@ -28,6 +28,12 @@ def create(disk_desc):
disk
.
create
()
@celery.task
()
def
create_ci_disk
(
disk_desc
,
meta_data
,
user_data
):
disk
=
Disk
.
deserialize
(
disk_desc
)
disk
.
create_ci_disk
(
meta_data
=
meta_data
,
user_data
=
user_data
)
class
download
(
AbortableTask
):
time_limit
=
18000
# TODO: calculate proper value it's 5h now
...
...
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