Browse Source

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)
tags/7.0.8
Ben Nemec 1 year ago
parent
commit
56448dafed
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      common/deploy-steps-tasks.yaml

+ 5
- 5
common/deploy-steps-tasks.yaml View File

@@ -1,6 +1,6 @@
1 1
     # Note the indentation here is required as it's joined
2 2
     # to create a playbook in deploy-steps.j2
3
-   
3
+
4 4
     #####################################################
5 5
     # Per step puppet configuration of the baremetal host
6 6
     #####################################################
@@ -22,7 +22,7 @@
22 22
       register: outputs
23 23
       failed_when: false
24 24
       no_log: true
25
-    - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
25
+    - debug: var=outputs.stdout_lines|default([])|union(outputs.stderr_lines|default([]))
26 26
       when: outputs.rc is defined
27 27
       failed_when: outputs.rc not in [0, 2]
28 28
     ######################################
@@ -40,7 +40,7 @@
40 40
       register: outputs
41 41
       failed_when: false
42 42
       no_log: true
43
-    - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
43
+    - debug: var=outputs.stdout_lines|default([])|union(outputs.stderr_lines|default([]))
44 44
       when: outputs.rc is defined
45 45
       failed_when: outputs.rc != 0
46 46
     ##################################################
@@ -64,7 +64,7 @@
64 64
       register: outputs
65 65
       failed_when: false
66 66
       no_log: true
67
-    - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
67
+    - debug: var=outputs.stdout_lines|default([])|union(outputs.stderr_lines|default([]))
68 68
       when: outputs.rc is defined
69 69
       failed_when: outputs.rc != 0
70 70
     ########################################################
@@ -87,6 +87,6 @@
87 87
       register: outputs
88 88
       failed_when: false
89 89
       no_log: true
90
-    - debug: var=(outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
90
+    - debug: var=outputs.stdout_lines|default([])|union(outputs.stderr_lines|default([]))
91 91
       when: outputs.rc is defined
92 92
       failed_when: outputs.rc != 0

Loading…
Cancel
Save