def get_instance_metadata(version='latest', url='http://169.254.169.254', data='meta-data/', timeout=None, num_retries=5):
 try:
  metadata_url = _build_instance_metadata_url(url, version, data)
  return _get_instance_metadata(metadata_url, num_retries=num_retries, timeout=timeout)
 except urllib.error.URLError:
  boto.log.exception('Exception caught when trying to retrieve instance metadata for: %s', data)
  return None

def get_instance_metadata ( version = 'latest' , url = 'http://169.254.169.254' , data = 'meta-data/' , timeout = None , num_retries = 5 ) : try : metadata_url = _build_instance_metadata_url ( url , version , data ) return _get_instance_metadata ( metadata_url , num_retries = num_retries , timeout = timeout ) except urllib . error . URLError : boto . log . exception ( 'Exception caught when trying to retrieve instance metadata for: %s' , data ) return None
returns the instance metadata as a nested python dictionary .