Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
7086132c
authored
Feb 26, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: fix filename generation code
parent
1cf58446
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
circle/storage/models.py
+6
-5
No files found.
circle/storage/models.py
View file @
7086132c
...
@@ -166,10 +166,8 @@ class Disk(AclBase, TimeStampedModel):
...
@@ -166,10 +166,8 @@ class Disk(AclBase, TimeStampedModel):
if
self
.
type
not
in
type_mapping
.
keys
():
if
self
.
type
not
in
type_mapping
.
keys
():
raise
self
.
WrongDiskTypeError
(
self
.
type
)
raise
self
.
WrongDiskTypeError
(
self
.
type
)
if
self
.
type
==
'iso'
:
filename
=
self
.
filename
filename
=
self
.
filename
if
self
.
type
==
'iso'
else
None
else
:
self
.
generate_filename
()
new_type
=
type_mapping
[
self
.
type
]
new_type
=
type_mapping
[
self
.
type
]
return
Disk
.
objects
.
create
(
base
=
self
,
datastore
=
self
.
datastore
,
return
Disk
.
objects
.
create
(
base
=
self
,
datastore
=
self
.
datastore
,
...
@@ -210,9 +208,12 @@ class Disk(AclBase, TimeStampedModel):
...
@@ -210,9 +208,12 @@ class Disk(AclBase, TimeStampedModel):
def
clean
(
self
,
*
args
,
**
kwargs
):
def
clean
(
self
,
*
args
,
**
kwargs
):
if
self
.
size
==
""
and
self
.
base
:
if
self
.
size
==
""
and
self
.
base
:
self
.
size
=
self
.
base
.
size
self
.
size
=
self
.
base
.
size
super
(
Disk
,
self
)
.
clean
(
*
args
,
**
kwargs
)
def
save
(
self
,
*
args
,
**
kwargs
):
if
self
.
filename
is
None
:
if
self
.
filename
is
None
:
self
.
generate_filename
()
self
.
generate_filename
()
super
(
Disk
,
self
)
.
clean
(
*
args
,
**
kwargs
)
return
super
(
Disk
,
self
)
.
save
(
*
args
,
**
kwargs
)
def
deploy
(
self
,
user
=
None
,
task_uuid
=
None
):
def
deploy
(
self
,
user
=
None
,
task_uuid
=
None
):
"""Reify the disk model on the associated data store.
"""Reify the disk model on the associated data store.
...
...
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