Permalink
Browse files

mod utils.py:get_instance_metadata allowing access to dynamic data

  • Loading branch information...
Royce Remer authored and toastdriven committed Mar 13, 2013
1 parent c835004 commit 2fdd7a56b54c204f2df6fc48c9978d1499c5cf10
Showing with 2 additions and 2 deletions.
  1. +2 −2 boto/utils.py
View
@@ -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
@@ -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

0 comments on commit 2fdd7a5

Please sign in to comment.