Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4c11f5b4
authored
4 years ago
by
Máhonfai Bálint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add filename field to disk export
parent
86c7b4e9
Pipeline
#1390
passed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
circle/dashboard/forms.py
+4
-1
circle/storage/models.py
+1
-3
circle/vm/operations.py
+2
-2
No files found.
circle/dashboard/forms.py
View file @
4c11f5b4
...
@@ -824,6 +824,7 @@ class VmCreateDiskForm(OperationForm):
...
@@ -824,6 +824,7 @@ class VmCreateDiskForm(OperationForm):
class
VmDiskExportForm
(
OperationForm
):
class
VmDiskExportForm
(
OperationForm
):
exported_name
=
forms
.
CharField
(
max_length
=
100
,
label
=
_
(
'Filename'
))
disk_format
=
forms
.
ChoiceField
(
disk_format
=
forms
.
ChoiceField
(
choices
=
Disk
.
EXPORT_FORMATS
,
choices
=
Disk
.
EXPORT_FORMATS
,
label
=
_
(
'Format'
))
label
=
_
(
'Format'
))
...
@@ -850,7 +851,9 @@ class VmDiskExportForm(OperationForm):
...
@@ -850,7 +851,9 @@ class VmDiskExportForm(OperationForm):
HTML
(
_
(
"<label>Disk:</label>
%
s"
)
%
escape
(
self
.
disk
)),
HTML
(
_
(
"<label>Disk:</label>
%
s"
)
%
escape
(
self
.
disk
)),
css_class
=
"form-group"
,
css_class
=
"form-group"
,
),
),
Field
(
'disk'
),
Field
(
'disk_format'
)
Field
(
'disk'
),
Field
(
'exported_name'
),
Field
(
'disk_format'
)
)
)
return
helper
return
helper
...
...
This diff is collapsed.
Click to expand it.
circle/storage/models.py
View file @
4c11f5b4
...
@@ -497,9 +497,7 @@ class Disk(TimeStampedModel):
...
@@ -497,9 +497,7 @@ class Disk(TimeStampedModel):
disk
.
save
()
disk
.
save
()
return
disk
return
disk
def
export
(
self
,
disk_format
,
upload_link
,
task
):
def
export
(
self
,
exported_name
,
disk_format
,
upload_link
,
task
):
exported_name
=
self
.
name
if
self
.
name
!=
''
else
self
.
filename
queue_name
=
self
.
get_remote_queue_name
(
'storage'
,
priority
=
'slow'
)
queue_name
=
self
.
get_remote_queue_name
(
'storage'
,
priority
=
'slow'
)
remote
=
storage_tasks
.
export_disk
.
apply_async
(
remote
=
storage_tasks
.
export_disk
.
apply_async
(
kwargs
=
{
kwargs
=
{
...
...
This diff is collapsed.
Click to expand it.
circle/vm/operations.py
View file @
4c11f5b4
...
@@ -389,10 +389,10 @@ class ExportDiskOperation(InstanceOperation):
...
@@ -389,10 +389,10 @@ class ExportDiskOperation(InstanceOperation):
except
NoStoreException
:
except
NoStoreException
:
raise
PermissionDenied
raise
PermissionDenied
def
_operation
(
self
,
user
,
disk
,
disk_format
,
task
):
def
_operation
(
self
,
user
,
disk
,
exported_name
,
disk_format
,
task
):
store
=
Store
(
user
)
store
=
Store
(
user
)
upload_link
=
store
.
request_upload
(
'/'
)
upload_link
=
store
.
request_upload
(
'/'
)
disk
.
export
(
disk_format
,
upload_link
,
task
)
disk
.
export
(
exported_name
,
disk_format
,
upload_link
,
task
)
@register_operation
@register_operation
...
...
This diff is collapsed.
Click to expand it.
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