diff options
author | James Cammarata <jimi@sngx.net> | 2016-01-27 09:56:19 -0500 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2016-01-28 16:02:54 -0500 |
commit | 43cf527fe7f4e21fed730236c0e7d11cec732e68 (patch) | |
tree | 5e532a3682c5688da7bed85db8b0c16b23032c18 | |
parent | a074ebedbcd1e1f1ac938a5955b65dac3ec96d92 (diff) | |
download | ansible-43cf527fe7f4e21fed730236c0e7d11cec732e68.tar.gz |
Don't try to generate retry files if the tqm hasn't been initialized
Fixes #14144
-rw-r--r-- | lib/ansible/executor/playbook_executor.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/ansible/executor/playbook_executor.py b/lib/ansible/executor/playbook_executor.py index d109b5296a..30d9ad6d6b 100644 --- a/lib/ansible/executor/playbook_executor.py +++ b/lib/ansible/executor/playbook_executor.py @@ -172,22 +172,22 @@ class PlaybookExecutor: if entry: 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 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) # if the last result wasn't zero, break out of the playbook file name loop |