Skip to content

Commit e50f090

Browse files
authored
Merge pull request #48 from CodeNow/extend-aws-tag-retrieval-time
This will keep retrying the retrieval of tags for dock-init
2 parents 616010e + 8a4a487 commit e50f090

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

lib/aws.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,25 @@ aws::get_org_ids() {
5252
# Note: this only works for us-.{4}-\d
5353
export REGION=$(ec2-metadata --availability-zone | awk '{ where = match($2, /us\-.+\-[1|2]/); print substr($2, where, 9); }')
5454

55-
backoff aws::fetch_org_id
56-
backoff aws::fetch_poppa_id
57-
if [[ "$ORG_ID" == "" ]]; then
58-
# this will print an error, so that's good
59-
rollbar::report_error \
60-
"Dock-Init: Org ID is Empty After cut" \
61-
"Evidently the Org ID was bad, and we have an empty ORG_ID."
62-
# we can not continue, halt
63-
halter::halt
64-
fi
55+
while [[ "$ORG_ID" == "" ]]
56+
do
57+
aws::fetch_org_id
58+
sleep 2
59+
done
60+
61+
while [[ "$POPPA_ID" == "" ]]
62+
do
63+
aws::fetch_poppa_id
64+
sleep 2
65+
done
6566

6667
log::info "Got Org ID: $ORG_ID"
6768
log::info "Got Poppa ID: $POPPA_ID"
6869
}
6970

7071
aws::fetch_org_id() {
7172
local attempt=${1}
72-
log::info 'Attempting to get org id on prem'
73+
log::info 'Attempting to get org id'
7374
data='{"attempt":'"${attempt}"'}'
7475

7576
rollbar::warning_trap \

0 commit comments

Comments
 (0)