Swap the order of stdout and stderr in debug output

Generally this data is looked at because something failed, and in
that case the relevant error is likely to be at the end of stderr.
By concatenating the output stderr first and then stdout as we were
it is possible for the stderr to get lost entirely in the failures
list, and even if that doesn't happen it's best to output the
relevant error right at the end of the output where people will
see it.  Previously it would be buried in the middle of the debug
output.

Closes-bug: #1743754

Change-Id: I952fd1af5778ade1eb6b0599d983f98cadeb7f6f
(cherry picked from commit 5595e7fc14)
This commit is contained in:
Ben Nemec 2017-11-22 17:09:13 -06:00 committed by Bogdan Dobrelya
parent ce68dbf5a4
commit 56448dafed
1 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# Note the indentation here is required as it's joined
# to create a playbook in deploy-steps.j2
#####################################################
# Per step puppet configuration of the baremetal host
#####################################################
@ -22,7 +22,7 @@
register: outputs
failed_when: false
no_log: true
- debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
- debug: var=outputs.stdout_lines|default([])|union(outputs.stderr_lines|default([]))
when: outputs.rc is defined
failed_when: outputs.rc not in [0, 2]
######################################
@ -40,7 +40,7 @@
register: outputs
failed_when: false
no_log: true
- debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
- debug: var=outputs.stdout_lines|default([])|union(outputs.stderr_lines|default([]))
when: outputs.rc is defined
failed_when: outputs.rc != 0
##################################################
@ -64,7 +64,7 @@
register: outputs
failed_when: false
no_log: true
- debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
- debug: var=outputs.stdout_lines|default([])|union(outputs.stderr_lines|default([]))
when: outputs.rc is defined
failed_when: outputs.rc != 0
########################################################
@ -87,6 +87,6 @@
register: outputs
failed_when: false
no_log: true
- debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
- debug: var=outputs.stdout_lines|default([])|union(outputs.stderr_lines|default([]))
when: outputs.rc is defined
failed_when: outputs.rc != 0