File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,12 @@ All notable changes to this project will be documented in this file.
2525 config value wasn't being honored. (Bug Fix)
2626
2727 Contributed by Nick Maludy (@nmaludy )
28-
28+
29+ * Fixed a bug in ` patching::update ` task on RHEL where errors in the ` yum ` command we're
30+ being reported due to the use of a ` | ` . Now we check ` $PIPESTATUS[0] ` instead of ` $? ` . (Bug Fix)
31+
32+ Contributed by Nick Maludy (@nmaludy )
33+
2934* Added new configuration options:
3035 * ` patching_reboot_wait ` : Parameter controls the ` reboot_wait ` option for the number of seconds
3136 to wait between reboots. Default = 300
Original file line number Diff line number Diff line change 6767STATUS=0
6868
6969# # Yum package manager
70- YUM_UPDATE=$( yum -y update $PACKAGES | tee -a " $LOG_FILE " )
70+ #
71+ # Because we're using '| tee' inside a $(), we can't just check $? after the command
72+ # as it will return the exit code of the LAST thing in the pipe,
73+ # instead we really want to return code of the `yum` command (first thing in the pipe).
74+ # For this to work, we need to exit the command in the $() with a value
75+ # from the $PIPESTATUS array to get access to the `yum` command's return value.
76+ # Now, the exit status for the $() will be whatever the exit status is for `yum` instead
77+ # of the exit status of `tee`.
78+ YUM_UPDATE=$( yum -y update $PACKAGES | tee -a " $LOG_FILE " ; exit ${PIPESTATUS[0]} )
7179STATUS=$?
7280
7381# check if packages were updated or not
You can’t perform that action at this time.
0 commit comments