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
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
19 deletions
+30
-19
circle/vm/models.py
+2
-2
circle/vm/tasks/local_tasks.py
+28
-17
No files found.
circle/vm/models.py
View file @
8dabd835
...
...
@@ -626,8 +626,8 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
def
wake_up_async
(
self
,
user
=
None
):
"""Execute wake_up asynchronously.
"""
local_tasks
.
resume
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
local_tasks
.
wake_up
.
apply_async
(
args
=
[
self
,
user
],
queue
=
"localhost.man"
)
def
shutdown
(
self
,
user
=
None
,
task_uuid
=
None
):
"""Shutdown virtual machine with ACPI signal.
...
...
circle/vm/tasks/local_tasks.py
View file @
8dabd835
from
manager.mancelery
import
celery
# TODO: Keep syncronhised with Instance funcs
# TODO: Keep synchronised with Instance funcs
@celery.task
def
deploy
(
instance
,
user
):
''' Call Insance.deploy() from celery task.
'''
instance
.
deploy
(
task_uuid
=
deploy
.
request
.
id
,
user
=
user
)
def
destroy
():
pass
@celery.task
def
destroy
(
instance
,
user
):
instance
.
destroy
(
task_uuid
=
destroy
.
request
.
id
,
user
=
user
)
def
save_as
():
pass
@celery.task
def
sleep
(
instance
,
user
):
instance
.
sleep
(
task_uuid
=
sleep
.
request
.
id
,
user
=
user
)
def
suspend
():
pass
@celery.task
def
wake_up
(
instance
,
user
):
instance
.
wake_up
(
task_uuid
=
wake_up
.
request
.
id
,
user
=
user
)
def
resume
():
pass
@celery.task
def
shutdown
(
instance
,
user
):
instance
.
shutdown
(
task_uuid
=
shutdown
.
request
.
id
,
user
=
user
)
def
restart
():
pass
@celery.task
def
reset
(
instance
,
user
):
instance
.
reset
(
task_uuid
=
reset
.
request
.
id
,
user
=
user
)
def
reset
():
pass
@celery.task
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