added some testing code to the snmpget builtin and renamed service to services/

This commit is contained in:
Johannes Findeisen 2013-06-10 04:14:53 +02:00
commit 4b0238c515
8 changed files with 58 additions and 0 deletions

24
lib/services/service.py Normal file
View file

@ -0,0 +1,24 @@
class Service:
def __init__(self, host, parser):
self.host = host
self.parser = parser
self.errorcode = 0
self.errormessage = "No Error!"
def _execute(self):
self.pre_execute()
executionResult = self.execute()
parseResult = self.parse_result(executionResult)
self.handle_result(parseResult)
def execute(self):
pass
def pre_execute(self):
pass
def parse_result(self, executionResult):
return self.parser._parse(executionResult)
def handle_result(self, parseResult):
pass