diff --git a/lib/config/members.py b/lib/config/members.py index 33f193d..1491e78 100644 --- a/lib/config/members.py +++ b/lib/config/members.py @@ -3,14 +3,17 @@ import re class Member: def __init__(self, nameid, name="", phone="", comment="", parent="", tasks=None): - self.id = id + self.id = nameid self.name = name self.phone = phone self.tasks = [] self.add_task(tasks) self.comment = comment self.parent = parent - + + def get_id(self): + return self.id + def add_task(self, task): if task is None: return diff --git a/lib/config/parser.py b/lib/config/parser.py index 93a37ac..a16205b 100644 --- a/lib/config/parser.py +++ b/lib/config/parser.py @@ -240,7 +240,7 @@ class FullConfigParser(ConfigParser): #replace object pointer id_list_func = lambda hostgroup: hostgroup.get_members() - id_get_func = lambda member: member.id + id_get_func = lambda member: member.get_id() self.replace_pointer(hostgroups, members, id_list_func, id_get_func) id_list_func = lambda service: service.get_periods() diff --git a/lib/parsers/parser.py b/lib/parsers/parser.py index 6906df0..8ba3028 100644 --- a/lib/parsers/parser.py +++ b/lib/parsers/parser.py @@ -1,5 +1,5 @@ class Parser: - def __init__(self): + def __init__(self, **kwargs): pass def parse_data(self, data): diff --git a/lib/parsers/shell.py b/lib/parsers/shell.py index 9e44bbe..c767cb3 100644 --- a/lib/parsers/shell.py +++ b/lib/parsers/shell.py @@ -2,7 +2,7 @@ from lib.parsers.parser import Parser class ShellParser(Parser): - def __init__(self): + def __init__(self, **kwargs): pass diff --git a/lib/processors/mariadb.py b/lib/processors/mariadb.py index 3cc83c3..d077d5b 100644 --- a/lib/processors/mariadb.py +++ b/lib/processors/mariadb.py @@ -6,7 +6,7 @@ from lib.processors.processor import Processor class MariadbProcessor(Processor): - def __init__(self): + def __init__(self, **kwargs): pass diff --git a/lib/processors/mongodb.py b/lib/processors/mongodb.py index e159ff6..5c521f5 100644 --- a/lib/processors/mongodb.py +++ b/lib/processors/mongodb.py @@ -6,7 +6,7 @@ from lib.processors.processor import Processor class MongodbProcessor(Processor): - def __init__(self): + def __init__(self, **kwargs): pass diff --git a/lib/processors/processor.py b/lib/processors/processor.py index c45b363..08d5c88 100644 --- a/lib/processors/processor.py +++ b/lib/processors/processor.py @@ -4,5 +4,5 @@ The processor class for postprocessing polled data. class Processor: - def __init__(self): + def __init__(self, **kwargs): pass \ No newline at end of file diff --git a/lib/processors/syslog.py b/lib/processors/syslog.py index 5dd8d8a..84897fa 100644 --- a/lib/processors/syslog.py +++ b/lib/processors/syslog.py @@ -6,7 +6,7 @@ from lib.processors.processor import Processor class SyslogProcessor(Processor): - def __init__(self): + def __init__(self, **kwargs): pass diff --git a/lib/services/http.py b/lib/services/http.py index 254bb4b..6e8dfda 100644 --- a/lib/services/http.py +++ b/lib/services/http.py @@ -51,5 +51,5 @@ class HttpService(Service): #print f.read() -def create(**kwargs): +def create(kwargs): return HttpService(**kwargs) \ No newline at end of file diff --git a/lib/services/snmpget.py b/lib/services/snmpget.py index f59b7d2..ec07b3f 100644 --- a/lib/services/snmpget.py +++ b/lib/services/snmpget.py @@ -52,5 +52,5 @@ class SnmpgetService(Service): # print('%s = %s' % (name.prettyPrint(), val.prettyPrint())) -def create(kargs): +def create(kwargs): return SnmpgetService(**kwargs) \ No newline at end of file