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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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
Hide 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):
...
@@ -57,6 +57,14 @@ class Disk(TimeStampedModel):
verbose_name
=
_
(
'disk'
)
verbose_name
=
_
(
'disk'
)
verbose_name_plural
=
_
(
'disks'
)
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
@property
def
path
(
self
):
def
path
(
self
):
return
self
.
datastore
.
path
+
'/'
+
self
.
filename
return
self
.
datastore
.
path
+
'/'
+
self
.
filename
...
@@ -71,13 +79,13 @@ class Disk(TimeStampedModel):
...
@@ -71,13 +79,13 @@ class Disk(TimeStampedModel):
'raw-rw'
:
'raw'
,
'raw-rw'
:
'raw'
,
}[
self
.
type
]
}[
self
.
type
]
class
WrongDiskTypeError
(
Exception
):
@property
def
__init__
(
self
,
type
):
def
device_type
(
self
):
self
.
type
=
type
return
{
'qcow2'
:
'vd'
,
def
__str__
(
self
):
'raw'
:
'vd'
,
return
(
"Operation can't be invoked on a disk of type '
%
s'."
%
'iso'
:
'hd'
,
self
.
type
)
}[
self
.
format
]
def
get_exclusive
(
self
):
def
get_exclusive
(
self
):
"""Get an instance of the disk for exclusive usage.
"""Get an instance of the disk for exclusive usage.
...
@@ -96,14 +104,6 @@ class Disk(TimeStampedModel):
...
@@ -96,14 +104,6 @@ class Disk(TimeStampedModel):
filename
=
filename
,
name
=
self
.
name
,
filename
=
filename
,
name
=
self
.
name
,
size
=
self
.
size
,
type
=
new_type
)
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
):
def
get_vmdisk_desc
(
self
):
return
{
return
{
'source'
:
self
.
path
,
'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