1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Don't try to generate retry files if the tqm hasn't been initialized

Fixes #14144
This commit is contained in:
James Cammarata 2016-01-27 09:56:19 -05:00
parent 7e3963420d
commit a61e51efb7

View file

@ -172,22 +172,22 @@ class PlaybookExecutor:
if entry: if entry:
entrylist.append(entry) # per playbook entrylist.append(entry) # per playbook
if C.RETRY_FILES_ENABLED:
retries = list(set(self._tqm._failed_hosts.keys() + self._tqm._unreachable_hosts.keys()))
retries.sort()
if len(retries) > 0:
if C.RETRY_FILES_SAVE_PATH:
basedir = C.shell_expand(C.RETRY_FILES_SAVE_PATH)
else:
basedir = os.path.dirname(playbook_path)
(retry_name, _) = os.path.splitext(os.path.basename(playbook_path))
filename = os.path.join(basedir, "%s.retry" % retry_name)
if self._generate_retry_inventory(filename, retries):
display.display("\tto retry, use: --limit @%s\n" % filename)
# send the stats callback for this playbook # send the stats callback for this playbook
if self._tqm is not None: if self._tqm is not None:
if C.RETRY_FILES_ENABLED:
retries = list(set(self._tqm._failed_hosts.keys() + self._tqm._unreachable_hosts.keys()))
retries.sort()
if len(retries) > 0:
if C.RETRY_FILES_SAVE_PATH:
basedir = C.shell_expand(C.RETRY_FILES_SAVE_PATH)
else:
basedir = os.path.dirname(playbook_path)
(retry_name, _) = os.path.splitext(os.path.basename(playbook_path))
filename = os.path.join(basedir, "%s.retry" % retry_name)
if self._generate_retry_inventory(filename, retries):
display.display("\tto retry, use: --limit @%s\n" % filename)
self._tqm.send_callback('v2_playbook_on_stats', self._tqm._stats) self._tqm.send_callback('v2_playbook_on_stats', self._tqm._stats)
# if the last result wasn't zero, break out of the playbook file name loop # if the last result wasn't zero, break out of the playbook file name loop