Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod utils.py:get_instance_metadata allowing access to dynamic data #1383

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions boto/utils.py
Expand Up @@ -311,7 +311,7 @@ def __repr__(self):


def get_instance_metadata(version='latest', url='http://169.254.169.254',
timeout=None, num_retries=5):
data='meta-data', timeout=None, num_retries=5):
"""
Returns the instance metadata as a nested Python dictionary.
Simple values (e.g. local_hostname, hostname, etc.) will be
Expand All @@ -327,7 +327,7 @@ def get_instance_metadata(version='latest', url='http://169.254.169.254',
original = socket.getdefaulttimeout()
socket.setdefaulttimeout(timeout)
try:
return _get_instance_metadata('%s/%s/meta-data/' % (url, version),
return _get_instance_metadata('%s/%s/%s/' % (url, version, data),
num_retries=num_retries)
except urllib2.URLError, e:
return None
Expand Down