From 65221c1c2fc3cf6483d0bf1c8bd3b9d53de3378a Mon Sep 17 00:00:00 2001 From: Tony Green Date: Fri, 10 Aug 2018 12:06:57 +1000 Subject: [PATCH 1/2] Missed a new variable --- tasks/patch_server.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/patch_server.rb b/tasks/patch_server.rb index a5dd3652..01cadd3f 100755 --- a/tasks/patch_server.rb +++ b/tasks/patch_server.rb @@ -258,7 +258,7 @@ def reboot_required yum_status.split("\n").each do |line| matchdata = line.match(/^Return-Code\s+:\s+(.*)$/) next unless matchdata - puts matchdata[1] + yum_return = matchdata[1] end pkg_hash = {} @@ -272,7 +272,7 @@ def reboot_required pkg_hash[matchdata[2]] = matchdata[1] end - output(yum_status.chomp, reboot, security_only, 'Patching complete', pkg_hash, yum_output, job, pinned_pkgs, starttime) + output(yum_return, reboot, security_only, 'Patching complete', pkg_hash, yum_output, job, pinned_pkgs, starttime) log.debug 'Patching complete' elsif facts['os']['family'] == 'Debian' # The security only workflow for Debain is a little complex, retiring it for now From 779e2d95fa4fb8fb2ad0461b9f45f91e64dfe26a Mon Sep 17 00:00:00 2001 From: Tony Green Date: Fri, 10 Aug 2018 12:09:32 +1000 Subject: [PATCH 2/2] Missed a new variable --- tasks/patch_server.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/patch_server.rb b/tasks/patch_server.rb index 01cadd3f..c75108b0 100755 --- a/tasks/patch_server.rb +++ b/tasks/patch_server.rb @@ -254,6 +254,7 @@ def reboot_required # Capture the yum return code log.debug "Getting yum return code for job #{job}" yum_status, stderr, status = Open3.capture3("yum history info #{job}") + yum_return = '' err(status, 'os_patching/yum', stderr, starttime) if status != 0 yum_status.split("\n").each do |line| matchdata = line.match(/^Return-Code\s+:\s+(.*)$/)