Commit 48f8974e by Bach Dániel

add renew task

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