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
1cf58446
authored
Feb 26, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: clean up Disk.create_empty
parent
0a27abe6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
circle/storage/models.py
+8
-12
No files found.
circle/storage/models.py
View file @
1cf58446
...
@@ -270,22 +270,18 @@ class Disk(AclBase, TimeStampedModel):
...
@@ -270,22 +270,18 @@ class Disk(AclBase, TimeStampedModel):
self
.
filename
=
str
(
uuid
.
uuid4
())
self
.
filename
=
str
(
uuid
.
uuid4
())
@classmethod
@classmethod
def
create_empty
(
cls
,
instance
=
None
,
params
=
None
,
def
create_empty
(
cls
,
instance
=
None
,
user
=
None
,
**
kwargs
):
user
=
None
,
task_uuid
=
None
):
"""Create empty Disk object.
"""Create empty Disk object.
:param instance: instnace object to connect disk
:param instance: Instance attach the Disk to.
:type instane: vm.models.Instance
:type instane: vm.models.Instance or NoneType
:param params: disk custom parameters
:param user: Creator of the disk.
:type params: dict
:param user: owner of the disk
:type user: django.contrib.auth.User
:type user: django.contrib.auth.User
:return: Disk object without a real image, to be .deploy()ed later.
"""
"""
with
disk_activity
(
code_suffix
=
"create"
,
task_uuid
=
task_uuid
,
with
disk_activity
(
code_suffix
=
"create"
,
user
=
user
)
as
act
:
user
=
user
)
as
act
:
disk
=
cls
(
**
kwargs
)
disk
=
cls
()
if
params
:
disk
.
__dict__
.
update
(
params
)
if
disk
.
filename
is
None
:
if
disk
.
filename
is
None
:
disk
.
generate_filename
()
disk
.
generate_filename
()
disk
.
save
()
disk
.
save
()
...
...
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