Skip to content

Commit e027b3f

Browse files
committed
ci: install-windows-updates fix get_windows_updates_remaining loop
It appears that the new(er) version of `govc` does not retain/return the exit code of a process when checking `guest.ps`, so that if a process that was `guest.start`'ed exits before the process can be checked the resulting JSON response will not contain an exit code (or at least that appears to be what is happening). In stead of breaking out of the loop to check for remaining updates when there is _any_ response, we now check to see if the response is null or not.
1 parent 0dfac0b commit e027b3f

File tree

1 file changed

+3
-3
lines changed
  • ci/tasks/install-windows-updates

1 file changed

+3
-3
lines changed

ci/tasks/install-windows-updates/run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ run_powershell_command_with_logging 'Install-PackageProvider -Name NuGet -Minimu
9090
run_powershell_command_with_logging 'Install-Module -Name PSWindowsUpdate -MinimumVersion 2.1.0.1 -Force'
9191

9292
updates_remaining=$(get_windows_updates_remaining)
93-
echo "Windows Updates to install: ${updates_remaining}" >&2
93+
echo "Initial Windows Updates to install: ${updates_remaining}" >&2
9494

9595
while [[ ${updates_remaining} -ne 0 ]]; do
9696
set +e # ignore unreachable agent if the vm just went down for reboot
@@ -100,12 +100,12 @@ while [[ ${updates_remaining} -ne 0 ]]; do
100100
wait_for_vm_to_come_up
101101

102102
updates_remaining=""
103-
while [[ -z "${updates_remaining}" || "${updates_remaining}" == "null" ]] ; do
103+
while [[ "${updates_remaining}" != "null" ]] ; do
104104
set +e # ignore failures here since the vmware tools agent may be down while updates are being applied
105105
updates_remaining=$(get_windows_updates_remaining)
106106
set -e
107107
done
108-
echo "Updates remaining: ${updates_remaining}" >&2
108+
echo "Remaining Windows Updates to install: ${updates_remaining}" >&2
109109
done
110110

111111
remote_hotfix_log_path="C:\\hotfix.log"

0 commit comments

Comments
 (0)