Skip to content

Commit

Permalink
Fix #877: fix implicit inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
mohierf committed Jul 26, 2017
1 parent 3c28635 commit 59ab106
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion alignak/objects/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,9 +1534,11 @@ def apply_implicit_inheritance(self, hosts):
'escalations', 'poller_tag', 'reactionner_tag', 'check_period',
'business_impact', 'maintenance_period'):
for serv in self:
if not hasattr(serv, prop) and hasattr(serv, 'host_name'):
if hasattr(serv, 'host_name') and not getattr(serv, prop, None):
host = hosts.find_by_name(serv.host_name)
if host is not None and hasattr(host, prop):
logger.debug("Implicit inheritance for %s/%s: %s = %s",
serv.host_name, serv, prop, getattr(host, prop))
setattr(serv, prop, getattr(host, prop))

def apply_dependencies(self, hosts):
Expand Down
3 changes: 2 additions & 1 deletion alignak/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,8 @@ def put_results(self, action): # pylint: disable=too-many-branches,too-many-sta
ref = self.find_item_by_id(self.checks[action.uuid].ref)
logger.info("%s %s command '%s' timed out after %d seconds",
ref.__class__.my_type.capitalize(), # pylint: disable=E1101
_type, self.actions[action.uuid].command, int(action.execution_time))
_type, self.actions[action.uuid].command,
int(action.execution_time))

self.nb_checks_results_timeout += 1
self.counters[action.is_a]["total"]["timeout"] += 1
Expand Down

0 comments on commit 59ab106

Please sign in to comment.