summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Roche <phil.roche@canonical.com>2016-06-13 09:52:52 +0100
committerPhil Roche <phil.roche@canonical.com>2016-06-13 09:52:52 +0100
commit52982e178a08e25e953d6b65cf64df93169c1ff7 (patch)
tree4df0ca8cfe0b0b2b97b3de2e18224edd0e293edc
parenta3efb2c405b2b206c70415508153fd93888f0a53 (diff)
downloadcloud-init-52982e178a08e25e953d6b65cf64df93169c1ff7.tar.gz
Removes trailing dot in metadata.google.internal GCE metadata lookup.
A bug was reported (lp:1581200) where if there is no DNS server configured or it is not running then the metadata lookup on GCE will fail as it contains a trailing dot 'metadata.google.internal.'. As there is no DNS configured or running it will use the /etc/hosts file but the hosts file does not contain an entry with the trailing dot. One solution is to add an entry to the /etc/hosts file with the trailing dot but according to the manpage, /etc/hosts entries must end with an alphanumeric character and cannot end with a dot. The trailing dot was added to avoid MIM by dns search but we should probably assume the instance being started has no DNS and as such when querying metadata should use a URL that will resolve using /etc/hosts.
-rw-r--r--cloudinit/sources/DataSourceGCE.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceGCE.py b/cloudinit/sources/DataSourceGCE.py
index 9234d1f8..c660a350 100644
--- a/cloudinit/sources/DataSourceGCE.py
+++ b/cloudinit/sources/DataSourceGCE.py
@@ -25,7 +25,7 @@ from cloudinit import util
LOG = logging.getLogger(__name__)
BUILTIN_DS_CONFIG = {
- 'metadata_url': 'http://metadata.google.internal./computeMetadata/v1/'
+ 'metadata_url': 'http://metadata.google.internal/computeMetadata/v1/'
}
REQUIRED_FIELDS = ('instance-id', 'availability-zone', 'local-hostname')