Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
fwdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cc4e9a06
authored
Oct 12, 2014
by
Bach Dániel
Committed by
Your Name
Oct 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove legacy cloud support
parent
10e3ea7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
17 deletions
+5
-17
fw.py
+2
-11
miscellaneous/firewall.conf
+3
-6
No files found.
fw.py
View file @
cc4e9a06
...
@@ -14,29 +14,20 @@ FIREWALL_CONF = getenv('FIREWALL_CONF', 'firewall.conf')
...
@@ -14,29 +14,20 @@ FIREWALL_CONF = getenv('FIREWALL_CONF', 'firewall.conf')
CACHE_URI
=
getenv
(
'CACHE_URI'
)
CACHE_URI
=
getenv
(
'CACHE_URI'
)
AMQP_URI
=
getenv
(
'AMQP_URI'
)
AMQP_URI
=
getenv
(
'AMQP_URI'
)
LEGACY
=
getenv
(
'LEGACY'
,
'False'
)
.
upper
()
==
'TRUE'
celery
=
Celery
(
'tasks'
,)
celery
=
Celery
(
'tasks'
,)
celery
.
conf
.
update
(
CELERY_TASK_RESULT_EXPIRES
=
300
,
celery
.
conf
.
update
(
CELERY_TASK_RESULT_EXPIRES
=
300
,
BROKER_URL
=
AMQP_URI
,
BROKER_URL
=
AMQP_URI
,
CELERY_CREATE_MISSING_QUEUES
=
True
)
CELERY_CREATE_MISSING_QUEUES
=
True
)
if
not
LEGACY
:
celery
.
conf
.
update
(
CELERY_CACHE_BACKEND
=
CACHE_URI
,
celery
.
conf
.
update
(
CELERY_CACHE_BACKEND
=
CACHE_URI
,
CELERY_RESULT_BACKEND
=
'cache'
)
CELERY_RESULT_BACKEND
=
'cache'
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
@task
(
name
=
"firewall.reload_firewall"
)
@task
(
name
=
"firewall.reload_firewall"
)
def
reload_firewall
(
data4
,
data6
,
save_config
=
True
):
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
:
try
:
ns_exec
(
NETNS
,
(
'ip6tables-restore'
,
'-c'
),
data6
)
ns_exec
(
NETNS
,
(
'ip6tables-restore'
,
'-c'
),
data6
)
ns_exec
(
NETNS
,
(
'iptables-restore'
,
'-c'
),
data4
)
ns_exec
(
NETNS
,
(
'iptables-restore'
,
'-c'
),
data4
)
...
...
miscellaneous/firewall.conf
View file @
cc4e9a06
...
@@ -13,12 +13,9 @@ script
...
@@ -13,12 +13,9 @@ script
cd
/
home
/
fw
/
fwdriver
cd
/
home
/
fw
/
fwdriver
. /
home
/
fw
/.
virtualenvs
/
fw
/
bin
/
postactivate
. /
home
/
fw
/.
virtualenvs
/
fw
/
bin
/
postactivate
. /
home
/
fw
/.
virtualenvs
/
fw
/
bin
/
activate
. /
home
/
fw
/.
virtualenvs
/
fw
/
bin
/
activate
if
[
"$LEGACY"
=
"TRUE"
];
then
HOSTNAME
=$(
hostname
-
s
)
exec
celeryd
-
A
fw
-
Q
dhcp
,
firewall
--
loglevel
=
info
-
c
1
exec
celeryd
-
A
fw
-
Q
${
HOSTNAME
}.
firewall
--
loglevel
=
info
-
c
1
else
HOSTNAME
=$(
hostname
-
s
)
exec
celeryd
-
A
fw
-
Q
${
HOSTNAME
}.
firewall
--
loglevel
=
info
-
c
1
fi
end
script
end
script
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