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.

Change-Id: I952fd1af5778ade1eb6b0599d983f98cadeb7f6f
This commit is contained in:
Ben Nemec 2017-11-22 17:09:13 -06:00
parent eeabc17247
commit 5595e7fc14
1 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@
failed_when: false
no_log: true
become: 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]
######################################
@ -43,7 +43,7 @@
failed_when: false
no_log: true
become: 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
##################################################
@ -69,7 +69,7 @@
failed_when: false
no_log: true
become: 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
########################################################
@ -94,6 +94,6 @@
failed_when: false
no_log: true
become: 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