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
Commit
a3b06b7d
authored
Apr 01, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: added create_empty_async because create instantly deploy disk
parent
58c7e8e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
circle/storage/models.py
+9
-1
No files found.
circle/storage/models.py
View file @
a3b06b7d
...
...
@@ -355,7 +355,14 @@ class Disk(AclBase, TimeStampedModel):
return
disk
@classmethod
def
create_empty
(
cls
,
instance
=
None
,
user
=
None
,
**
kwargs
):
def
create_empty_async
(
cls
,
instance
=
None
,
user
=
None
,
**
kwargs
):
"""Execute deploy asynchronously.
"""
return
local_tasks
.
create_empty
.
apply_async
(
args
=
[
cls
,
instance
,
user
,
kwargs
],
queue
=
"localhost.man"
)
@classmethod
def
create_empty
(
cls
,
instance
=
None
,
user
=
None
,
task_uuid
=
None
,
**
kwargs
):
"""Create empty Disk object.
:param instance: Instance or template attach the Disk to.
...
...
@@ -366,6 +373,7 @@ class Disk(AclBase, TimeStampedModel):
:return: Disk object without a real image, to be .deploy()ed later.
"""
disk
=
Disk
.
create
(
instance
,
user
,
**
kwargs
)
disk
.
deploy
(
user
=
user
,
task_uuid
=
task_uuid
)
return
disk
@classmethod
...
...
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