Commit cc4e9a06 by Bach Dániel Committed by Your Name

remove legacy cloud support

parent 10e3ea7f
......@@ -14,29 +14,20 @@ FIREWALL_CONF = getenv('FIREWALL_CONF', 'firewall.conf')
CACHE_URI = getenv('CACHE_URI')
AMQP_URI = getenv('AMQP_URI')
LEGACY = getenv('LEGACY', 'False').upper() == 'TRUE'
celery = Celery('tasks',)
celery.conf.update(CELERY_TASK_RESULT_EXPIRES=300,
BROKER_URL=AMQP_URI,
CELERY_CREATE_MISSING_QUEUES=True)
if not LEGACY:
celery.conf.update(CELERY_CACHE_BACKEND=CACHE_URI,
CELERY_RESULT_BACKEND='cache')
celery.conf.update(CELERY_CACHE_BACKEND=CACHE_URI,
CELERY_RESULT_BACKEND='cache')
logger = logging.getLogger(__name__)
@task(name="firewall.reload_firewall")
def reload_firewall(data4, data6, save_config=True):
if isinstance(data4, dict):
data4 = ('\n'.join(data4['filter']) + '\n' +
'\n'.join(data4['nat']) + '\n')
if isinstance(data6, dict):
data6 = ('\n'.join(data6['filter']) + '\n')
try:
ns_exec(NETNS, ('ip6tables-restore', '-c'), data6)
ns_exec(NETNS, ('iptables-restore', '-c'), data4)
......
......@@ -13,12 +13,9 @@ script
cd /home/fw/fwdriver
. /home/fw/.virtualenvs/fw/bin/postactivate
. /home/fw/.virtualenvs/fw/bin/activate
if [ "$LEGACY" = "TRUE" ]; then
exec celeryd -A fw -Q dhcp,firewall --loglevel=info -c 1
else
HOSTNAME=$(hostname -s)
exec celeryd -A fw -Q ${HOSTNAME}.firewall --loglevel=info -c 1
fi
HOSTNAME=$(hostname -s)
exec celeryd -A fw -Q ${HOSTNAME}.firewall --loglevel=info -c 1
end script
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