Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b1bfe87f
authored
Oct 18, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: fixing device and types
parent
cbf15087
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
circle/storage/models.py
+8
-5
No files found.
circle/storage/models.py
View file @
b1bfe87f
...
@@ -85,7 +85,7 @@ class Disk(TimeStampedModel):
...
@@ -85,7 +85,7 @@ class Disk(TimeStampedModel):
return
{
return
{
'qcow2-norm'
:
'qcow2'
,
'qcow2-norm'
:
'qcow2'
,
'qcow2-snap'
:
'qcow2'
,
'qcow2-snap'
:
'qcow2'
,
'iso'
:
'
iso
'
,
'iso'
:
'
raw
'
,
'raw-ro'
:
'raw'
,
'raw-ro'
:
'raw'
,
'raw-rw'
:
'raw'
,
'raw-rw'
:
'raw'
,
}[
self
.
type
]
}[
self
.
type
]
...
@@ -93,10 +93,12 @@ class Disk(TimeStampedModel):
...
@@ -93,10 +93,12 @@ class Disk(TimeStampedModel):
@property
@property
def
device_type
(
self
):
def
device_type
(
self
):
return
{
return
{
'qcow2'
:
'vd'
,
'qcow2
-norm
'
:
'vd'
,
'
raw
'
:
'vd'
,
'
qcow2-snap
'
:
'vd'
,
'iso'
:
'hd'
,
'iso'
:
'hd'
,
}[
self
.
format
]
'raw-ro'
:
'vd'
,
'raw-rw'
:
'vd'
,
}[
self
.
type
]
def
is_in_use
(
self
):
def
is_in_use
(
self
):
return
self
.
instance_set
.
exclude
(
state
=
'SHUTOFF'
)
.
exists
()
return
self
.
instance_set
.
exclude
(
state
=
'SHUTOFF'
)
.
exists
()
...
@@ -127,7 +129,8 @@ class Disk(TimeStampedModel):
...
@@ -127,7 +129,8 @@ class Disk(TimeStampedModel):
'source'
:
self
.
path
,
'source'
:
self
.
path
,
'driver_type'
:
self
.
format
,
'driver_type'
:
self
.
format
,
'driver_cache'
:
'default'
,
'driver_cache'
:
'default'
,
'target_device'
:
self
.
device_type
+
self
.
dev_num
'target_device'
:
self
.
device_type
+
self
.
dev_num
,
'disk_device'
:
'cdrom'
if
self
.
type
==
'iso'
else
'disk'
}
}
def
get_disk_desc
(
self
):
def
get_disk_desc
(
self
):
...
...
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