summaryrefslogtreecommitdiff
path: root/cloudinit/boto_utils.py
diff options
context:
space:
mode:
authorkeyz182 <keyz182@gmail.com>2011-05-28 00:50:41 +0100
committerkeyz182 <keyz182@gmail.com>2011-05-28 00:50:41 +0100
commit2d1e87fb520292c6c30484ea7acad84adb0487d3 (patch)
treec68b50b5632fd5aae50261b7c68bd7d5ac72dcff /cloudinit/boto_utils.py
parentdeb6d2356e3989d09029264c74b7d65c8f4414a3 (diff)
downloadvyos-cloud-init-2d1e87fb520292c6c30484ea7acad84adb0487d3.tar.gz
vyos-cloud-init-2d1e87fb520292c6c30484ea7acad84adb0487d3.zip
Added support for loading metadata urls from config files.
Diffstat (limited to 'cloudinit/boto_utils.py')
-rw-r--r--cloudinit/boto_utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/boto_utils.py b/cloudinit/boto_utils.py
index e60e804d..a2cb9ca6 100644
--- a/cloudinit/boto_utils.py
+++ b/cloudinit/boto_utils.py
@@ -60,7 +60,7 @@ def retry_url(url, retry_on_404=True):
sys.stderr.write('Caught exception reading instance data, giving up\n')
return ''
-def get_instance_metadata(version='latest',url='http://169.254.169.254/'):
+def get_instance_metadata(version='latest',url='http://169.254.169.254'):
"""
Returns the instance metadata as a nested Python dictionary.
Simple values (e.g. local_hostname, hostname, etc.) will be
@@ -68,11 +68,11 @@ def get_instance_metadata(version='latest',url='http://169.254.169.254/'):
be stored in the dict as a list of string values. More complex
fields such as public-keys and will be stored as nested dicts.
"""
- url = '%s%s/meta-data/' % (url,version)
+ url = '%s/%s/meta-data/' % (url,version)
return _get_instance_metadata(url)
-def get_instance_userdata(version='latest', sep=None,url='http://169.254.169.254/'):
- url = '%s%s/user-data' % (url,version)
+def get_instance_userdata(version='latest', sep=None,url='http://169.254.169.254'):
+ url = '%s/%s/user-data' % (url,version)
user_data = retry_url(url, retry_on_404=False)
if user_data:
if sep: