Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
fwdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e8b1dda2
authored
3 years ago
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introducing celeryconfig.py
requirements fix encoding fix
parent
daab148e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
16 deletions
+31
-16
celeryconfig.py
+6
-0
fw.py
+5
-1
ovs.py
+1
-1
requirements/base.txt
+12
-12
utils.py
+7
-2
No files found.
celeryconfig.py
0 → 100644
View file @
e8b1dda2
CELERY_RESULT_BACKEND
=
'amqp://'
CELERY_TASK_RESULT_EXPIRES
=
300
CELERY_TIMEZONE
=
'UTC'
CELERY_ENABLE_UTC
=
True
CELERY_ACCEPT_CONTENT
=
[
'pickle'
,
'json'
,
'msgpack'
,
'yaml'
]
This diff is collapsed.
Click to expand it.
fw.py
View file @
e8b1dda2
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
ovs.py
View file @
e8b1dda2
...
...
@@ -270,4 +270,4 @@ class Bridge(Switch):
if
__name__
==
"__main__"
:
br
=
Bridge
(
'br0'
)
print
br
.
list_ports
(
)
print
(
br
.
list_ports
()
)
This diff is collapsed.
Click to expand it.
requirements/base.txt
View file @
e8b1dda2
setuptools
==0.9.
8
amqp==1.
0.13
setuptools
<5
8
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.1
0
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
This diff is collapsed.
Click to expand it.
utils.py
View file @
e8b1dda2
...
...
@@ -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
st
dout
return
st
r
(
stdout
)
def
ns_exec
(
args
,
stdin
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment