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
38633b61
authored
Sep 27, 2013
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: reorder members of Disk
parent
3d29b14c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
circle/storage/models.py
+15
-15
No files found.
circle/storage/models.py
View file @
38633b61
...
...
@@ -57,6 +57,14 @@ class Disk(TimeStampedModel):
verbose_name
=
_
(
'disk'
)
verbose_name_plural
=
_
(
'disks'
)
class
WrongDiskTypeError
(
Exception
):
def
__init__
(
self
,
type
):
self
.
type
=
type
def
__str__
(
self
):
return
(
"Operation can't be invoked on a disk of type '
%
s'."
%
self
.
type
)
@property
def
path
(
self
):
return
self
.
datastore
.
path
+
'/'
+
self
.
filename
...
...
@@ -71,13 +79,13 @@ class Disk(TimeStampedModel):
'raw-rw'
:
'raw'
,
}[
self
.
type
]
class
WrongDiskTypeError
(
Exception
):
def
__init__
(
self
,
type
):
self
.
type
=
type
def
__str__
(
self
):
return
(
"Operation can't be invoked on a disk of type '
%
s'."
%
self
.
type
)
@property
def
device_type
(
self
):
return
{
'qcow2'
:
'vd'
,
'raw'
:
'vd'
,
'iso'
:
'hd'
,
}[
self
.
format
]
def
get_exclusive
(
self
):
"""Get an instance of the disk for exclusive usage.
...
...
@@ -96,14 +104,6 @@ class Disk(TimeStampedModel):
filename
=
filename
,
name
=
self
.
name
,
size
=
self
.
size
,
type
=
new_type
)
@property
def
device_type
(
self
):
return
{
'qcow2'
:
'vd'
,
'raw'
:
'vd'
,
'iso'
:
'hd'
,
}[
self
.
format
]
def
get_vmdisk_desc
(
self
):
return
{
'source'
:
self
.
path
,
...
...
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