summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceGCE.py
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
commitdf583f83ac9d4869e0b3df5a904d13890d2f0986 (patch)
tree4df0ca8cfe0b0b2b97b3de2e18224edd0e293edc /cloudinit/sources/DataSourceGCE.py
parentcf7ba5b30597660b7ab4fbdd92f0762e0011c1d6 (diff)
downloadvyos-cloud-init-df583f83ac9d4869e0b3df5a904d13890d2f0986.tar.gz
vyos-cloud-init-df583f83ac9d4869e0b3df5a904d13890d2f0986.zip
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. LP: #1581200
Diffstat (limited to 'cloudinit/sources/DataSourceGCE.py')
-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')