From ebf50a2d99986476d66600c231ca000e83abf3e8 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Mon, 10 Jun 2013 05:20:50 +0200 Subject: [PATCH] who needs newlines...? --- lib/services/http.py | 6 ------ lib/services/snmpget.py | 10 ++++------ lib/services/tcpconnect.py | 1 - 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/services/http.py b/lib/services/http.py index 706d419..224f1a8 100644 --- a/lib/services/http.py +++ b/lib/services/http.py @@ -15,31 +15,25 @@ from service import Service class HttpService(Service): def __init__(self, parser, log, **kwargs): super(Service, self).__init__(parser) - if "string" in kwargs: self.string = kwargs["string"] else: log.w("There is no string set to match") raise - if "method" in kwargs: self.method = kwargs["method"] else: self.method = "get" - if "params" in kwargs: self.params = kwargs["params"] - if "path" in kwargs: self.path = kwargs["path"] else: self.path = "/" - if "port" in kwargs: self.port = kwargs["port"] else: self.port = "80" - if "protocol" in kwargs: self.protocol = kwargs["protocol"] else: diff --git a/lib/services/snmpget.py b/lib/services/snmpget.py index 38357d6..fde9f9d 100644 --- a/lib/services/snmpget.py +++ b/lib/services/snmpget.py @@ -7,20 +7,18 @@ from service import Service class SnmpgetService(Service): - def __init__(self, **kwargs): - + def __init__(self, parser, log, **kwargs): + super(Service, self).__init__(parser) if "community" in kwargs: self.community = kwargs["community"] else: - #log.w("There is no community") + log.w("There is no community") raise - if "oid" in kwargs: self.oid = kwargs["oid"] else: - #log.w("There is no oid") + log.w("There is no oid") raise - if "port" in kwargs: self.port = kwargs["port"] else: diff --git a/lib/services/tcpconnect.py b/lib/services/tcpconnect.py index b81bc7e..43b043c 100644 --- a/lib/services/tcpconnect.py +++ b/lib/services/tcpconnect.py @@ -12,7 +12,6 @@ from service import Service class TcpconnectService(Service): def __init__(self, parser, log, **kwargs): super(Service, self).__init__(parser) - if "port" in kwargs: self.port = kwargs["port"] else: