Commit 406a7949 by Guba Sándor

Adding celery workers

parent 9f3a4d19
from celery import Celery
from kombu import Queue, Exchange
from socket import gethostname
HOSTNAME = gethostname()
celery = Celery('netdriver', backend='amqp',
broker='amqp://cloud:test@10.9.1.31/vmdriver',
include=['tasks'])
celery.conf.update(
CELERY_QUEUES=(
Queue(HOSTNAME + '.net', Exchange(
'netdriver', type='direct'), routing_key='netdriver'),
)
)
from celery import Celery
from kombu import Queue, Exchange
from socket import gethostname
import os
HOSTNAME = gethostname()
celery = Celery('vmcelery', backend='amqp',
broker='amqp://cloud:test@10.9.1.31/vmdriver',
include=['tasks'])
celery.conf.update(
CELERY_QUEUES=(
Queue(HOSTNAME + '.vm', Exchange(
'vmdriver', type='direct'), routing_key="vmdriver"),
)
)
if os.getenv('LIBVIRT_KEEPALIVE') is not None:
import libvirt
lib_connection = libvirt.open(os.getenv('LIBVIRT_URI'))
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