Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
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):
if
self
.
type
not
in
type_mapping
.
keys
():
raise
self
.
WrongDiskTypeError
(
self
.
type
)
if
self
.
type
==
'iso'
:
filename
=
self
.
filename
else
:
self
.
generate_filename
()
filename
=
self
.
filename
if
self
.
type
==
'iso'
else
None
new_type
=
type_mapping
[
self
.
type
]
return
Disk
.
objects
.
create
(
base
=
self
,
datastore
=
self
.
datastore
,
...
...
@@ -210,9 +208,12 @@ class Disk(AclBase, TimeStampedModel):
def
clean
(
self
,
*
args
,
**
kwargs
):
if
self
.
size
==
""
and
self
.
base
:
self
.
size
=
self
.
base
.
size
super
(
Disk
,
self
)
.
clean
(
*
args
,
**
kwargs
)
def
save
(
self
,
*
args
,
**
kwargs
):
if
self
.
filename
is
None
:
self
.
generate_filename
()
super
(
Disk
,
self
)
.
clean
(
*
args
,
**
kwargs
)
return
super
(
Disk
,
self
)
.
save
(
*
args
,
**
kwargs
)
def
deploy
(
self
,
user
=
None
,
task_uuid
=
None
):
"""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