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
7fab0904
authored
5 years ago
by
Bálint Máhonfai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Possible to choose format when exporting disk
parent
2a890679
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
circle/dashboard/forms.py
+5
-1
circle/storage/models.py
+4
-0
No files found.
circle/dashboard/forms.py
View file @
7fab0904
...
...
@@ -831,6 +831,10 @@ class VmCreateDiskForm(OperationForm):
class
VmDiskExportForm
(
OperationForm
):
format
=
forms
.
ChoiceField
(
choices
=
Disk
.
EXPORT_FORMATS
,
label
=
_
(
'Format'
))
def
__init__
(
self
,
*
args
,
**
kwargs
):
choices
=
kwargs
.
pop
(
'choices'
)
self
.
disk
=
kwargs
.
pop
(
'default'
)
...
...
@@ -853,7 +857,7 @@ class VmDiskExportForm(OperationForm):
HTML
(
_
(
"<label>Disk:</label>
%
s"
)
%
escape
(
self
.
disk
)),
css_class
=
"form-group"
,
),
Field
(
"disk"
),
Field
(
'disk'
),
Field
(
'format'
)
)
return
helper
...
...
This diff is collapsed.
Click to expand it.
circle/storage/models.py
View file @
7fab0904
...
...
@@ -125,6 +125,10 @@ class Disk(TimeStampedModel):
TYPES
=
[(
'qcow2-norm'
,
'qcow2 normal'
),
(
'qcow2-snap'
,
'qcow2 snapshot'
),
(
'iso'
,
'iso'
),
(
'raw-ro'
,
'raw read-only'
),
(
'raw-rw'
,
'raw'
)]
BUS_TYPES
=
((
'virtio'
,
'virtio'
),
(
'ide'
,
'ide'
),
(
'scsi'
,
'scsi'
))
EXPORT_FORMATS
=
((
'vmdk'
,
_
(
'VMware disk image'
)),
(
'qcow2'
,
_
(
'QEMU disk image'
)),
(
'vdi'
,
_
(
'VirtualBox disk image'
)),
(
'vpc'
,
_
(
'HyperV disk image'
)))
name
=
CharField
(
blank
=
True
,
max_length
=
100
,
verbose_name
=
_
(
"name"
))
filename
=
CharField
(
max_length
=
256
,
unique
=
True
,
verbose_name
=
_
(
"filename"
))
...
...
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