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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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
Show 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):
return
{
'qcow2-norm'
:
'qcow2'
,
'qcow2-snap'
:
'qcow2'
,
'iso'
:
'
iso
'
,
'iso'
:
'
raw
'
,
'raw-ro'
:
'raw'
,
'raw-rw'
:
'raw'
,
}[
self
.
type
]
...
...
@@ -93,10 +93,12 @@ class Disk(TimeStampedModel):
@property
def
device_type
(
self
):
return
{
'qcow2'
:
'vd'
,
'
raw
'
:
'vd'
,
'qcow2
-norm
'
:
'vd'
,
'
qcow2-snap
'
:
'vd'
,
'iso'
:
'hd'
,
}[
self
.
format
]
'raw-ro'
:
'vd'
,
'raw-rw'
:
'vd'
,
}[
self
.
type
]
def
is_in_use
(
self
):
return
self
.
instance_set
.
exclude
(
state
=
'SHUTOFF'
)
.
exists
()
...
...
@@ -127,7 +129,8 @@ class Disk(TimeStampedModel):
'source'
:
self
.
path
,
'driver_type'
:
self
.
format
,
'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
):
...
...
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