Commit e8b1dda2 by Szeberényi Imre

introducing celeryconfig.py

requirements fix
encoding fix
parent daab148e
CELERY_RESULT_BACKEND = 'amqp://'
CELERY_TASK_RESULT_EXPIRES = 300
CELERY_TIMEZONE = 'UTC'
CELERY_ENABLE_UTC = True
CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
......@@ -4,6 +4,7 @@ import re
import json
import logging
from utils import (ns_exec, sudo, ADDRESSES, get_network_type,
dhcp_no_free_re, dhcp_ack_re, is_there_systemd)
......@@ -15,6 +16,9 @@ CACHE_URI = getenv('CACHE_URI')
AMQP_URI = getenv('AMQP_URI')
celery = Celery('tasks',)
celery.config_from_object('celeryconfig')
celery.conf.update(CELERY_TASK_RESULT_EXPIRES=300,
BROKER_URL=AMQP_URI,
CELERY_CACHE_BACKEND=CACHE_URI,
......@@ -57,7 +61,7 @@ def reload_firewall_vlan(data, save_config=True):
if uplink:
data[uplink] = {'interfaces': uplink}
print network_type
print(network_type)
br = network_type('firewall')
br.migrate(data)
......
......@@ -270,4 +270,4 @@ class Bridge(Switch):
if __name__ == "__main__":
br = Bridge('br0')
print br.list_ports()
print(br.list_ports())
setuptools==0.9.8
amqp==1.0.13
setuptools<58
amqp==1.4.9
anyjson==0.3.3
argparse==1.2.1
billiard==2.7.3.32
celery==3.0.23
distribute==0.7.3
kombu==2.5.14
netaddr==0.7.10
python-dateutil==2.1
six==1.4.1
wsgiref==0.1.2
pylibmc
#argparse==1.2.1
billiard==3.3.0.23
celery==3.1.18
#distribute==0.7.3
kombu==3.0.30
netaddr==0.8.0
python-dateutil==2.8.2
six==1.16.0
#wsgiref==0.1.2
#pylibmc
......@@ -5,6 +5,11 @@ import logging
import json
import re
try:
basestring
except NameError:
basestring = str
logging.basicConfig()
logger = logging.getLogger(__name__)
......@@ -46,13 +51,13 @@ def sudo(args, stdin=None):
p = sp.Popen(args, stdin=sp.PIPE, stderr=sp.PIPE, stdout=sp.PIPE)
if isinstance(stdin, basestring):
stdout, stderr = p.communicate(stdin)
stdout, stderr = p.communicate(bytes(stdin, 'utf-8'))
else:
stdout, stderr = p.communicate()
if p.returncode != 0:
raise sp.CalledProcessError(
p.returncode, sp.list2cmdline(args), stderr)
return stdout
return str(stdout)
def ns_exec(args, stdin=None):
......
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