change service
This commit is contained in:
parent
2a400b9f4d
commit
360e1d68d0
1 changed files with 9 additions and 6 deletions
|
|
@ -32,8 +32,8 @@ class Service(object):
|
||||||
|
|
||||||
self._fails = {}
|
self._fails = {}
|
||||||
if KEY_FAILS in kwargs:
|
if KEY_FAILS in kwargs:
|
||||||
self.put_fails(kwargs[KEY_FAILS])
|
self.put_fails(kwargs[KEY_FAILS])
|
||||||
|
|
||||||
self._periods = []
|
self._periods = []
|
||||||
if KEY_PERIODS in kwargs:
|
if KEY_PERIODS in kwargs:
|
||||||
self.add_periods(kwargs[KEY_PERIODS])
|
self.add_periods(kwargs[KEY_PERIODS])
|
||||||
|
|
@ -107,11 +107,14 @@ class Service(object):
|
||||||
|
|
||||||
def _execute(self):
|
def _execute(self):
|
||||||
self.pre_execute()
|
self.pre_execute()
|
||||||
executionResult = self.execute()
|
result = {}
|
||||||
parseResult = self.parse_result(executionResult)
|
for host in self.get_hostgroup().get_hosts():
|
||||||
|
result[host] = self.execute(host)
|
||||||
|
|
||||||
|
parseResult = self.parse_result(result)
|
||||||
self.handle_result(parseResult)
|
self.handle_result(parseResult)
|
||||||
|
|
||||||
def execute(self):
|
def execute(self, host):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def pre_execute(self):
|
def pre_execute(self):
|
||||||
|
|
@ -120,7 +123,7 @@ class Service(object):
|
||||||
def parse_result(self, executionResult):
|
def parse_result(self, executionResult):
|
||||||
result = []
|
result = []
|
||||||
for parser in self.get_parser():
|
for parser in self.get_parser():
|
||||||
result.append(self._parser._parse(executionResult))
|
result.append(parser.parse(executionResult))
|
||||||
|
|
||||||
def handle_result(self, parseResult):
|
def handle_result(self, parseResult):
|
||||||
pass
|
pass
|
||||||
Loading…
Add table
Add a link
Reference in a new issue