From: Leandro Lucarella Date: Mon, 16 Jun 2008 20:03:41 +0000 (-0300) Subject: Remove plug-in code from handler module in services (refs #27). X-Git-Url: https://git.llucax.com/software/pymin.git/commitdiff_plain/fd09c4a43a9c0155e5b418246ca7f72632eefd8a Remove plug-in code from handler module in services (refs #27). --- diff --git a/services/dhcp/handler.py b/services/dhcp/handler.py index c33a555..f27f984 100644 --- a/services/dhcp/handler.py +++ b/services/dhcp/handler.py @@ -9,11 +9,7 @@ from pymin.service.util import Restorable, ConfigWriter, InitdHandler, \ TransactionalHandler, ParametersHandler, \ DictSubHandler, ReloadHandler -__all__ = ('DhcpHandler', 'get_service') - - -def get_service(config): - return DhcpHandler(config.dhcp.pickle_dir, config.dhcp.config_dir) +__all__ = ('DhcpHandler') class Host(Sequence): diff --git a/services/dns/handler.py b/services/dns/handler.py index 23046c5..fb66923 100644 --- a/services/dns/handler.py +++ b/services/dns/handler.py @@ -11,11 +11,7 @@ from pymin.service.util import Restorable, ConfigWriter, InitdHandler, \ TransactionalHandler, ParametersHandler, \ DictComposedSubHandler, DictSubHandler, call -__all__ = ('DnsHandler', 'get_service') - - -def get_service(config): - return DnsHandler(config.dns.pickle_dir, config.dns.config_dir) +__all__ = ('DnsHandler') class Host(Sequence): diff --git a/services/firewall/handler.py b/services/firewall/handler.py index 50a8dfb..b234167 100644 --- a/services/firewall/handler.py +++ b/services/firewall/handler.py @@ -14,11 +14,7 @@ from pymin.dispatcher import Handler, handler, HandlerError from pymin.service.util import Restorable, ConfigWriter, ServiceHandler, \ TransactionalHandler, ListSubHandler -__all__ = ('FirewallHandler', 'get_service') - - -def get_service(config): - return FirewallHandler(config.firewall.pickle_dir, config.firewall.config_dir) +__all__ = ('FirewallHandler') class UpOneOf(OneOf): diff --git a/services/ip/handler.py b/services/ip/handler.py index 2bbc288..cf2c18b 100644 --- a/services/ip/handler.py +++ b/services/ip/handler.py @@ -12,11 +12,7 @@ from pymin.service.util import Restorable, ConfigWriter, InitdHandler, \ DictComposedSubHandler, ListSubHandler, \ Device, Address, ExecutionError -__all__ = ('IpHandler', 'get_service') - - -def get_service(config): - return IpHandler(config.ip.pickle_dir, config.ip.config_dir) +__all__ = ('IpHandler') class Hop(Sequence): diff --git a/services/nat/handler.py b/services/nat/handler.py index 32e2608..042a23c 100644 --- a/services/nat/handler.py +++ b/services/nat/handler.py @@ -9,11 +9,7 @@ from pymin.service.util import Restorable, ConfigWriter, RestartHandler, \ ReloadHandler, TransactionalHandler, \ ServiceHandler, ListSubHandler, call -__all__ = ('NatHandler', 'get_service') - - -def get_service(config): - return NatHandler(config.nat.pickle_dir) +__all__ = ('NatHandler') class PortForward(Sequence): diff --git a/services/ppp/handler.py b/services/ppp/handler.py index 9c6bdff..6dc835f 100644 --- a/services/ppp/handler.py +++ b/services/ppp/handler.py @@ -11,11 +11,7 @@ from pymin.dispatcher import Handler, handler, HandlerError from pymin.service.util import Restorable, ConfigWriter, ReloadHandler, \ TransactionalHandler, DictSubHandler, call -__all__ = ('PppHandler', 'get_service') - - -def get_service(config): - return PppHandler(config.ppp.pickle_dir, config.ppp.config_dir) +__all__ = ('PppHandler') class ConnectionError(HandlerError, KeyError): diff --git a/services/proxy/handler.py b/services/proxy/handler.py index 63237e1..a2e86e5 100644 --- a/services/proxy/handler.py +++ b/services/proxy/handler.py @@ -10,11 +10,7 @@ from pymin.service.util import Restorable, ConfigWriter, InitdHandler, \ TransactionalHandler, ParametersHandler, \ DictSubHandler -__all__ = ('ProxyHandler', 'get_service') - - -def get_service(config): - return ProxyHandler(config.proxy.pickle_dir, config.proxy.config_dir) +__all__ = ('ProxyHandler') class Host(Sequence): diff --git a/services/qos/handler.py b/services/qos/handler.py index c175049..9b07bb0 100644 --- a/services/qos/handler.py +++ b/services/qos/handler.py @@ -10,11 +10,7 @@ from pymin.service.util import Restorable, ConfigWriter, InitdHandler, \ get_network_devices, ListComposedSubHandler, \ DictComposedSubHandler, ExecutionError -__all__ = ('QoSHandler', 'get_service') - - -def get_service(config): - return QoSHandler(config.qos.pickle_dir, config.qos.config_dir) +__all__ = ('QoSHandler') class DeviceError(HandlerError): diff --git a/services/vpn/handler.py b/services/vpn/handler.py index 4f0e04b..802e089 100644 --- a/services/vpn/handler.py +++ b/services/vpn/handler.py @@ -11,11 +11,7 @@ from pymin.dispatcher import Handler, handler, HandlerError from pymin.service.util import Restorable, ConfigWriter, InitdHandler, \ TransactionalHandler, DictSubHandler, DictComposedSubHandler, call, ExecutionError -__all__ = ('VpnHandler', 'get_service') - - -def get_service(config): - return VpnHandler(config.vpn.pickle_dir, config.vpn.config_dir) +__all__ = ('VpnHandler') class Host(Sequence): diff --git a/services/vrrp/handler.py b/services/vrrp/handler.py index 2f51263..9d8e5b5 100644 --- a/services/vrrp/handler.py +++ b/services/vrrp/handler.py @@ -7,11 +7,7 @@ from pymin.service.util import Restorable, TransactionalHandler, \ ReloadHandler, RestartHandler, \ ServiceHandler, ParametersHandler -__all__ = ('VrrpHandler', 'get_service') - - -def get_service(config): - return VrrpHandler(config.vrrp.pickle_dir, config.vrrp.config_dir) +__all__ = ('VrrpHandler') # FIXME the the command should not use new parameters unless commit where called