Skip to content

Commit

Permalink
wip: Exit polling loop if status is complete, both password and ip ar…
Browse files Browse the repository at this point in the history
…e set
  • Loading branch information
jcfr committed May 7, 2024
1 parent 592cbdf commit a743aa2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/create-instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,20 @@ jobs:
jq -r .exoSetup | \
jq -r .status)
if [ "$status" = "complete" ]; then
has_pwd=$(
openstack server show $INSTANCE_NAME -c tags -f json | \
jq -r '.tags[] | startswith("exoPw")')
has_ip=$(
openstack server show $INSTANCE_NAME -c addresses -f json | \
jq -r '.addresses.auto_allocated_network[1] != null'
)
if [ "$status" = "complete" && has_pwd $$ $has_ip ]; then
echo "Status is complete. Exiting loop."
break
else
echo "Status is $status. Waiting for completion..."
echo "Status is '$status', has_pwd is '$has_pwd', has_ip is '$has_ip'. Waiting for completion..."
sleep $wait_interval
total_wait_time=$((total_wait_time + wait_interval))
fi
Expand Down

0 comments on commit a743aa2

Please sign in to comment.