Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
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
6a79de67
authored
Oct 02, 2013
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: add openvswitch support
parent
95ef0c6d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
circle/firewall/fw.py
+8
-0
circle/firewall/tasks/local_tasks.py
+9
-0
circle/firewall/tasks/remote_tasks.py
+5
-0
No files found.
circle/firewall/fw.py
View file @
6a79de67
...
@@ -436,3 +436,11 @@ def dhcp():
...
@@ -436,3 +436,11 @@ def dhcp():
})
})
return
DHCP
return
DHCP
def
vlan
():
obj
=
models
.
Vlan
.
objects
.
values
(
'vid'
,
'name'
,
'network4'
,
'network6'
)
return
{
x
[
'name'
]:
{
'tag'
:
x
[
'vid'
],
'addresses'
:
[
str
(
x
[
'network4'
]),
str
(
x
[
'network6'
])]}
for
x
in
obj
}
circle/firewall/tasks/local_tasks.py
View file @
6a79de67
...
@@ -29,6 +29,12 @@ def periodic_task():
...
@@ -29,6 +29,12 @@ def periodic_task():
queue
=
'firewall'
)
queue
=
'firewall'
)
print
"firewall ujratoltese kesz"
print
"firewall ujratoltese kesz"
if
cache
.
get
(
'firewall_vlan_lock'
):
cache
.
delete
(
"firewall_vlan_lock"
)
remote_tasks
.
reload_firewall_vlan
.
apply_async
(
args
=
[
vlan
()],
queue
=
'firewall'
)
print
"firewall_vlan ujratoltese kesz"
if
cache
.
get
(
'blacklist_lock'
):
if
cache
.
get
(
'blacklist_lock'
):
cache
.
delete
(
"blacklist_lock"
)
cache
.
delete
(
"blacklist_lock"
)
remote_tasks
.
reload_blacklist
.
apply_async
(
args
=
[
list
(
ipset
())],
remote_tasks
.
reload_blacklist
.
apply_async
(
args
=
[
list
(
ipset
())],
...
@@ -50,4 +56,7 @@ def reloadtask(type='Host'):
...
@@ -50,4 +56,7 @@ def reloadtask(type='Host'):
if
type
==
"Blacklist"
:
if
type
==
"Blacklist"
:
cache
.
add
(
"blacklist_lock"
,
"true"
,
30
)
cache
.
add
(
"blacklist_lock"
,
"true"
,
30
)
if
type
==
"Vlan"
:
cache
.
add
(
"firewall_vlan_lock"
,
"true"
,
30
)
print
type
print
type
circle/firewall/tasks/remote_tasks.py
View file @
6a79de67
...
@@ -11,6 +11,11 @@ def reload_firewall(data4, data6):
...
@@ -11,6 +11,11 @@ def reload_firewall(data4, data6):
pass
pass
@celery.task
(
name
=
'firewall.reload_firewall_vlan'
)
def
reload_firewall_vlan
(
data
):
pass
@celery.task
(
name
=
'firewall.reload_dhcp'
)
@celery.task
(
name
=
'firewall.reload_dhcp'
)
def
reload_dhcp
(
data
):
def
reload_dhcp
(
data
):
pass
pass
...
...
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