Ansible-runner is failing when passing host to display

Ansible-runner is using their own custom call back and it appears to be
failing when actually set to a non-string. Check to make sure host is a
string or just unset it if it isn't a string value.

Change-Id: Ib67b6bd69ed1c3f9fcd32552b6599cbe4ff478ce
Closes-Bug: #1904917
Alex Schultz 2 years ago
parent 10e2d0eead
commit e737f3bfd4
  1. 3
  2. 2

@ -51,6 +51,9 @@ class TripleoBase(StrategyBase):
self._has_hosts_cache_all = False
def _print(self, msg, host=None, level=1):
# host needs to be a string or bad things happen. LP#1904917
if host and not isinstance(host, str):
host = None
display.verbose(msg, host=host, caplevel=level)
def _debug(self, msg, host=None):

@ -147,7 +147,7 @@ class StrategyModule(BASE.TripleoBase):
def _advance_host(self, host, task):
"""Advance the host's task as necessary"""
self._debug('_advance_host {}'.format(host), host)
self._debug('_advance_host {}'.format(host))
host_name = host.get_name()
# build get_vars call params