[Fix] import job crashloop

- Relied on JSON field names being in a deterministic order. This
  is not guaranteed. Update import job to no longer assume this.

Change-Id: I8d0a3abae94b99a94df61346b504517e2cb4a8ca
This commit is contained in:
Scott Hussey 2018-03-26 12:25:31 -05:00
parent 794a8b5ffb
commit 219c821b22
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ function check_for_download {
let JOB_TIMEOUT-=${RETRY_TIMER}
sleep ${RETRY_TIMER}
else
synced_imgs=$(maas ${ADMIN_USERNAME} boot-resources read | grep -B 3 'Synced' | grep 'ubuntu' | wc -l)
synced_imgs=$(maas ${ADMIN_USERNAME} boot-resources read | tr -d '\n' | grep -oE '{[^}]+}' | grep ubuntu | grep -c Synced)
if [[ $synced_imgs -gt 0 ]]
then
echo 'Boot resources have completed importing'