Fix GCE DNS readiness polling.

If the `hostname` commands used in the polling loop fail, their stdout
is going to be empty and so `getent hosts` command will actually
succeed.  For the loop to work as expected, make sure the subcommands
return a string which is an invalid host name.
This commit is contained in:
aalexand 2015-10-31 16:53:57 -07:00
parent 7b8bf758f3
commit 26439bb225

View File

@ -32,11 +32,11 @@ function ensure-basic-networking() {
echo 'Waiting for functional DNS (trying to resolve metadata.google.internal)...'
sleep 3
done
until getent hosts $(hostname -f) &>/dev/null; do
until getent hosts $(hostname -f || echo _error_) &>/dev/null; do
echo 'Waiting for functional DNS (trying to resolve my own FQDN)...'
sleep 3
done
until getent hosts $(hostname -i) &>/dev/null; do
until getent hosts $(hostname -i || echo _error_) &>/dev/null; do
echo 'Waiting for functional DNS (trying to resolve my own IP)...'
sleep 3
done