Commit 8dabd835 by Dudás Ádám

vm: sync local tasks with model changes

parent 72393682
...@@ -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):
......
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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment