Commit 0cd25578 authored by Valentin Samir's avatar Valentin Samir
Browse files

[generate] Ménage concernant le pare-feu

parent 6f44de3e
......@@ -145,14 +145,19 @@ class base_reconfigure:
service.machines = machines
service.reconfigure()
def __fw(self):
if not hasattr(self, '__real_fw'):
from firewall4 import firewall
self.__real_fw = firewall()
return self.__real_fw
def macip(self, ips):
if platform.dist()[1] >= '6':
import firewall_new
firewall = firewall_new
else:
import firewall
cprint(u"Mise a jour correspondance MAC-IP", 'gras')
eval("firewall.firewall_%s()" % hostname).mac_ip_maj(ips)
self.__fw().mac_ip_maj(ips)
def blacklist(self, ips):
cprint(u"Mise a jour des blacklists", 'gras')
self.__fw().blacklist_maj(ips)
class redisdead(base_reconfigure):
def droits(self):
......@@ -216,20 +221,6 @@ class zamok(base_reconfigure):
from adherents import del_user
self._do(del_user(args))
def __fw(self):
if not hasattr(self, '__real_fw'):
from firewall4 import firewall_zamok
self.__real_fw = firewall_zamok()
return self.__real_fw
def blacklist(self, ips):
cprint(u"Mise a jour des blacklists", 'gras')
self.__fw().blacklist_maj(ips)
def macip(self, ips):
cprint(u"Mise a jour correspondance MAC-IP", 'gras')
self.__fw().mac_ip_maj(ips)
class daath(base_reconfigure):
def home(self, args):
from adherents import home
......@@ -246,11 +237,6 @@ class daath(base_reconfigure):
class komaz(base_reconfigure):
def __fw(self):
if not hasattr(self, '__real_fw'):
from firewall4 import firewall_komaz
self.__real_fw = firewall_komaz()
return self.__real_fw
# Mimtisme de ma part -- xhub
def __fw6(self):
......@@ -293,10 +279,6 @@ class sable(base_reconfigure):
from gen_confs.bind import dns
self._do(dns(), self._machines())
def macip(self, ips):
from firewall_new import firewall_sable
firewall_sable().mac_ip_maj(ips)
class ovh(base_reconfigure):
pass
......@@ -304,19 +286,7 @@ class charybde(base_reconfigure):
pass
class routeur(base_reconfigure):
def __fw(self):
if not hasattr(self, '__real_fw'):
from firewall4 import firewall_routeur
self.__real_fw = firewall_routeur()
return self.__real_fw
def blacklist(self, ips):
cprint(u"Mise a jour des blacklists", 'gras')
self.__fw().blacklist_maj(ips)
def macip(self, ips):
cprint(u"Mise a jour correspondance MAC-IP", 'gras')
self.__fw().mac_ip_maj(ips)
pass
class gordon(base_reconfigure) :
def dhcp(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment