summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceMAAS.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-21 17:54:42 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-21 17:54:42 -0700
commit8bd9ce21c0de36376be3056575dac2df34332854 (patch)
tree7f400fe812d096a5df27750fd23f730b4d57ab1c /cloudinit/sources/DataSourceMAAS.py
parentd570f064d6e3407615588c6e03442404b7df1283 (diff)
downloadvyos-cloud-init-8bd9ce21c0de36376be3056575dac2df34332854.tar.gz
vyos-cloud-init-8bd9ce21c0de36376be3056575dac2df34332854.zip
Ensure that calling the urls happens in a specified order.
Diffstat (limited to 'cloudinit/sources/DataSourceMAAS.py')
-rw-r--r--cloudinit/sources/DataSourceMAAS.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceMAAS.py b/cloudinit/sources/DataSourceMAAS.py
index 22c90b7c..f16d5c21 100644
--- a/cloudinit/sources/DataSourceMAAS.py
+++ b/cloudinit/sources/DataSourceMAAS.py
@@ -172,6 +172,12 @@ def read_maas_seed_url(seed_url, header_cb=None, timeout=None,
* <seed_url>/<version>/user-data
"""
base_url = "%s/%s" % (seed_url, version)
+ file_order = [
+ 'local-hostname',
+ 'instance-id',
+ 'public-keys',
+ 'user-data',
+ ]
files = {
'local-hostname': "%s/%s" % (base_url, 'meta-data/local-hostname'),
'instance-id': "%s/%s" % (base_url, 'meta-data/instance-id'),
@@ -179,7 +185,8 @@ def read_maas_seed_url(seed_url, header_cb=None, timeout=None,
'user-data': "%s/%s" % (base_url, 'user-data'),
}
md = {}
- for (name, url) in files:
+ for name in file_order:
+ url = files.get(name)
if header_cb:
headers = header_cb(url)
else: