summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceOpenStack.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-09-10 16:46:11 -0400
committerScott Moser <smoser@ubuntu.com>2014-09-10 16:46:11 -0400
commit2755274f34ef11651a5ee57a31955f3e413cdfc4 (patch)
treef412e70ba415f7438f2ff94f35943d73ea39299b /cloudinit/sources/DataSourceOpenStack.py
parent4a03c618b58e4da727992441aa760057e5424379 (diff)
downloadvyos-cloud-init-2755274f34ef11651a5ee57a31955f3e413cdfc4.tar.gz
vyos-cloud-init-2755274f34ef11651a5ee57a31955f3e413cdfc4.zip
OpenStack: search less urls to determine if MD service is there.
We were checking for presense of meta_data.json for each supported metadata version. Instead just check that /openstack is there. This reduces the time to check on EC2 or any other cloud.
Diffstat (limited to 'cloudinit/sources/DataSourceOpenStack.py')
-rw-r--r--cloudinit/sources/DataSourceOpenStack.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/cloudinit/sources/DataSourceOpenStack.py b/cloudinit/sources/DataSourceOpenStack.py
index 466de8f4..765137c6 100644
--- a/cloudinit/sources/DataSourceOpenStack.py
+++ b/cloudinit/sources/DataSourceOpenStack.py
@@ -88,11 +88,9 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource):
md_urls = []
url2base = {}
for url in urls:
- for version in openstack.OS_VERSIONS + (openstack.OS_LATEST,):
- md_url = url_helper.combine_url(url, 'openstack',
- version, 'meta_data.json')
- md_urls.append(md_url)
- url2base[md_url] = url
+ md_url = url_helper.combine_url(url, 'openstack')
+ md_urls.append(md_url)
+ url2base[md_url] = url
(max_wait, timeout) = self._get_url_settings()
start_time = time.time()