Merge "Don't look for ansible_host unconditionally" into feature/zuulv3

This commit is contained in:
Jenkins 2017-07-09 16:36:52 +00:00 committed by Gerrit Code Review
commit 3259dfe022
1 changed files with 2 additions and 1 deletions

View File

@ -204,7 +204,8 @@ class CallbackModule(default.CallbackModule):
else:
task_host = result._host.get_name()
task_hostvars = result._task._variable_manager._hostvars[task_host]
if task_hostvars['ansible_host'] in localhost_names:
if task_hostvars.get('ansible_host', task_hostvars.get(
'ansible_inventory_host')) in localhost_names:
is_localhost = True
if not is_localhost and is_task: