Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
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
9bc075e4
authored
Jan 01, 2023
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disk download datastore
parent
01dd477c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
circle/dashboard/templates/dashboard/_disk-list-element.html
+1
-2
circle/storage/models.py
+4
-2
circle/vm/operations.py
+1
-1
No files found.
circle/dashboard/templates/dashboard/_disk-list-element.html
View file @
9bc075e4
...
@@ -5,8 +5,7 @@
...
@@ -5,8 +5,7 @@
{% if d.ci_disk %}
<i
class=
"fa fa-cloud-upload"
></i>
{% if d.ci_disk %}
<i
class=
"fa fa-cloud-upload"
></i>
{% endif %}
{% endif %}
{{ d.name }} (#{{ d.id }}) - {{ d.size|filesize }}
{{ d.name }} (
<i
class=
"fa fa-database"
></i>
{{ d.datastore.name }} #{{ d.id }}) - {{ d.size|filesize }}
<span
class=
"operation-wrapper pull-right"
>
<span
class=
"operation-wrapper pull-right"
>
{% if d.is_exportable %}
{% if d.is_exportable %}
...
...
circle/storage/models.py
View file @
9bc075e4
...
@@ -470,7 +470,7 @@ class Disk(TimeStampedModel):
...
@@ -470,7 +470,7 @@ class Disk(TimeStampedModel):
return
disk
return
disk
@classmethod
@classmethod
def
download
(
cls
,
url
,
task
,
user
=
None
,
resize
=
None
,
**
params
):
def
download
(
cls
,
url
,
task
,
user
=
None
,
resize
=
None
,
datastore
=
None
,
**
params
):
"""Create disk object and download data from url synchronusly.
"""Create disk object and download data from url synchronusly.
:param url: image url to download.
:param url: image url to download.
...
@@ -488,7 +488,9 @@ class Disk(TimeStampedModel):
...
@@ -488,7 +488,9 @@ class Disk(TimeStampedModel):
params
.
setdefault
(
'name'
,
url
.
split
(
'/'
)[
-
1
])
params
.
setdefault
(
'name'
,
url
.
split
(
'/'
)[
-
1
])
params
.
setdefault
(
'type'
,
'iso'
)
params
.
setdefault
(
'type'
,
'iso'
)
params
.
setdefault
(
'size'
,
None
)
params
.
setdefault
(
'size'
,
None
)
disk
=
cls
.
__create
(
params
=
params
,
user
=
user
)
if
not
datastore
:
datastore
=
DataStore
.
objects
.
filter
(
name
=
'default'
)
.
get
()
.
name
disk
=
cls
.
__create
(
params
=
params
,
user
=
user
,
datastore
=
datastore
)
queue_name
=
disk
.
get_remote_queue_name
(
'storage'
,
priority
=
'slow'
)
queue_name
=
disk
.
get_remote_queue_name
(
'storage'
,
priority
=
'slow'
)
remote
=
storage_tasks
.
download
.
apply_async
(
remote
=
storage_tasks
.
download
.
apply_async
(
kwargs
=
{
'url'
:
url
,
'parent_id'
:
task
.
request
.
id
,
kwargs
=
{
'url'
:
url
,
'parent_id'
:
task
.
request
.
id
,
...
...
circle/vm/operations.py
View file @
9bc075e4
...
@@ -366,7 +366,7 @@ class DownloadDiskOperation(InstanceOperation):
...
@@ -366,7 +366,7 @@ class DownloadDiskOperation(InstanceOperation):
concurrency_check
=
False
# warning!!!
concurrency_check
=
False
# warning!!!
def
_operation
(
self
,
user
,
url
,
task
,
activity
,
datastore
,
name
=
None
):
def
_operation
(
self
,
user
,
url
,
task
,
activity
,
datastore
,
name
=
None
):
disk
=
Disk
.
download
(
url
=
url
,
name
=
name
,
task
=
task
)
disk
=
Disk
.
download
(
url
=
url
,
name
=
name
,
task
=
task
,
datastore
=
datastore
.
name
)
devnums
=
list
(
ascii_lowercase
)
devnums
=
list
(
ascii_lowercase
)
for
d
in
self
.
instance
.
disks
.
all
():
for
d
in
self
.
instance
.
disks
.
all
():
devnums
.
remove
(
d
.
dev_num
)
devnums
.
remove
(
d
.
dev_num
)
...
...
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