Skip to content

Commit

Permalink
fix system env PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
Forbes Bear authored and Forbes Bear committed Dec 25, 2018
1 parent d0a9c9a commit c57c7ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ansible_api/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async def post(self): # Change the async method to python3 async, this performa
after=lambda: dict(task_list=[module])))
response = ansible_runner.interface.run(
host_pattern=target, inventory='/etc/ansible/hosts',
envvars=dict(PATH=sys.path[0]),
envvars=dict(PATH=os.environ.get('PATH')+':'+sys.path[0]),
ident=name, module=module, module_args=arg,
event_handler=cb.event_handler, status_handler=cb.status_handler
)
Expand Down Expand Up @@ -167,7 +167,7 @@ async def post(self):
cb.event_pepper('playbook_on_play_start', dict(task_list=task_list))
response = ansible_runner.interface.run(
host_pattern=hosts, inventory='/etc/ansible/hosts',
envvars=dict(PATH=sys.path[0]),
envvars=dict(PATH=os.environ.get('PATH')+':'+sys.path[0]),
playbook=yml_file, ident=name, extravars=my_vars,
event_handler=cb.event_handler, status_handler=cb.status_handler
)
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_api/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def detail(self):
if self._detail is not None:
# print('---->', self._detail)
detail = self._detail.copy()
options = ['cmd', 'changed', 'failures', 'ok', 'skipped']
options = ['cmd', 'changed', 'failures', 'ok', 'skipped', 'unreachable']
for o in options:
if o in detail['res']:
detail[o] = detail['res'][o]
Expand Down

0 comments on commit c57c7ef

Please sign in to comment.