Skip to content

Commit d11eeab

Browse files
committed
CI: update scripts for newer govc behavior
Newer govc versions do not have initial caps in JSON key names.
1 parent 2f31ff9 commit d11eeab

File tree

2 files changed

+4
-4
lines changed
  • ci/tasks
    • install-windows-updates
    • setup-integration-test-vm

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function run_pwsh_command_with_govc() {
3939
pid=$(
4040
$govc_pwsh_cmd ${command}
4141
)
42-
return=$(govc guest.ps -vm.ipath="${vm_ipath}" -l="${vm_username}:${vm_password}" -p=${pid} -X -json | jq '.ProcessInfo[0].ExitCode')
42+
return=$(govc guest.ps -vm.ipath="${vm_ipath}" -l="${vm_username}:${vm_password}" -p=${pid} -X -json | jq '.processInfo[0].exitCode')
4343
echo "${command} returned ${return}"
4444
}
4545

@@ -52,7 +52,7 @@ returnWindowsUpdateCount="exit (([array](Get-WindowsUpdate)).Count)"
5252
echo "getting update count"
5353
get_update_count_pid=$($govc_pwsh_cmd ${returnWindowsUpdateCount})
5454
echo "getting update count exit code via guest.ps"
55-
updates_remaining=$(govc guest.ps -vm.ipath="${vm_ipath}" -l="${vm_username}:${vm_password}" -p=${get_update_count_pid} -X -json | jq '.ProcessInfo[0].ExitCode')
55+
updates_remaining=$(govc guest.ps -vm.ipath="${vm_ipath}" -l="${vm_username}:${vm_password}" -p=${get_update_count_pid} -X -json | jq '.processInfo[0].exitCode')
5656
echo "Windows Updates to install: $updates_remaining"
5757
while [[ updates_remaining -ne 0 ]]; do
5858

ci/tasks/setup-integration-test-vm/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ while [ "${VM_IP}" != "${FOUND_IP_ADDRESS}" ]; do
4545
VM_INFO=$(govc vm.info -json "${CLONE_FOLDER}"/"${CLONE_NAME}")
4646

4747
FOUND_IP_ADDRESS=$(echo "${VM_INFO}" |
48-
jq -r ".VirtualMachines[0].Guest.Net[0].IpAddress | .[]? |select(. == \"${VM_IP}\")")
48+
jq -r ".virtualMachines[0].guest.net[0].ipAddress | .[]? |select(. == \"${VM_IP}\")")
4949

5050
echo "Current IP Addresses:"
51-
echo "${VM_INFO}" | jq -r ".VirtualMachines[0].Guest.Net[0].IpAddress | .[]?"
51+
echo "${VM_INFO}" | jq -r ".virtualMachines[0].guest.net[0].ipAddress | .[]?"
5252

5353
if [ ${SECONDS} -gt 600 ] ; then
5454
exit 1

0 commit comments

Comments
 (0)