Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
8dabd835
authored
Oct 08, 2013
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: sync local tasks with model changes
parent
72393682
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
18 deletions
+29
-18
circle/vm/models.py
+1
-1
circle/vm/tasks/local_tasks.py
+28
-17
No files found.
circle/vm/models.py
View file @
8dabd835
...
@@ -626,7 +626,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
...
@@ -626,7 +626,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
def
wake_up_async
(
self
,
user
=
None
):
def
wake_up_async
(
self
,
user
=
None
):
"""Execute wake_up asynchronously.
"""Execute wake_up asynchronously.
"""
"""
local_tasks
.
resume
.
apply_async
(
args
=
[
self
,
user
],
local_tasks
.
wake_up
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
queue
=
"localhost.man"
)
def
shutdown
(
self
,
user
=
None
,
task_uuid
=
None
):
def
shutdown
(
self
,
user
=
None
,
task_uuid
=
None
):
...
...
circle/vm/tasks/local_tasks.py
View file @
8dabd835
from
manager.mancelery
import
celery
from
manager.mancelery
import
celery
# TODO: Keep syncronhised with Instance funcs
# TODO: Keep synchronised with Instance funcs
@celery.task
@celery.task
def
deploy
(
instance
,
user
):
def
deploy
(
instance
,
user
):
''' Call Insance.deploy() from celery task.
'''
instance
.
deploy
(
task_uuid
=
deploy
.
request
.
id
,
user
=
user
)
instance
.
deploy
(
task_uuid
=
deploy
.
request
.
id
,
user
=
user
)
def
destroy
():
@celery.task
pass
def
destroy
(
instance
,
user
):
instance
.
destroy
(
task_uuid
=
destroy
.
request
.
id
,
user
=
user
)
def
save_as
():
@celery.task
pass
def
sleep
(
instance
,
user
):
instance
.
sleep
(
task_uuid
=
sleep
.
request
.
id
,
user
=
user
)
def
suspend
():
@celery.task
pass
def
wake_up
(
instance
,
user
):
instance
.
wake_up
(
task_uuid
=
wake_up
.
request
.
id
,
user
=
user
)
def
resume
():
@celery.task
pass
def
shutdown
(
instance
,
user
):
instance
.
shutdown
(
task_uuid
=
shutdown
.
request
.
id
,
user
=
user
)
def
restart
():
@celery.task
pass
def
reset
(
instance
,
user
):
instance
.
reset
(
task_uuid
=
reset
.
request
.
id
,
user
=
user
)
def
reset
():
@celery.task
pass
def
reboot
(
instance
,
user
):
instance
.
reboot
(
task_uuid
=
reboot
.
request
.
id
,
user
=
user
)
@celery.task
def
save_as
(
instance
,
user
):
instance
.
save_as
(
task_uuid
=
save_as
.
request
.
id
,
user
=
user
)
def
migrate
():
pass
@celery.task
def
migrate
(
instance
,
user
):
instance
.
migrate
(
task_uuid
=
migrate
.
request
.
id
,
user
=
user
)
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