Commit 48f8974e by Bach Dániel

add renew task

parent 93d7fdc0
...@@ -108,6 +108,11 @@ def send_notification(vm, msg): ...@@ -108,6 +108,11 @@ def send_notification(vm, msg):
command='send_notification', args={'msg': msg}) command='send_notification', args={'msg': msg})
@celery.task(name='vm.tasks.local_agent_tasks.renew')
def renew(vm):
print vm
@celery.task(name='vm.tasks.local_agent_tasks.agent_started') @celery.task(name='vm.tasks.local_agent_tasks.agent_started')
def agent_started(vm): def agent_started(vm):
print vm print vm
......
...@@ -11,7 +11,7 @@ from celery.result import TimeoutError ...@@ -11,7 +11,7 @@ from celery.result import TimeoutError
from utils import SerialLineReceiverBase from utils import SerialLineReceiverBase
from agentcelery import agent_started, agent_stopped from agentcelery import agent_started, agent_stopped, renew
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -63,11 +63,14 @@ class SerialLineReceiver(SerialLineReceiverBase): ...@@ -63,11 +63,14 @@ class SerialLineReceiver(SerialLineReceiverBase):
if command == 'agent_stopped': if command == 'agent_stopped':
agent_stopped.apply_async(queue='localhost.man', agent_stopped.apply_async(queue='localhost.man',
args=(self.factory.vm, )) args=(self.factory.vm, ))
if command == 'agent_started': elif command == 'agent_started':
version = args.get('version', None) version = args.get('version', None)
agent_started.apply_async(queue='localhost.man', agent_started.apply_async(queue='localhost.man',
args=(self.factory.vm, version)) args=(self.factory.vm, version))
if command == 'ping': elif command == 'renew':
renew.apply_async(queue='localhost.man',
args=(self.factory.vm, ))
elif command == 'ping':
self.send_response(response='pong', self.send_response(response='pong',
args=args) args=args)
......
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