def get_metadata_path(path):
 with start_action(action_type=u'flocker:node:agents:gce:get_metadata_path', path=path) as action:
  timeout_sec = 3
  r = requests.get((_METADATA_SERVER + path), headers=_METADATA_HEADERS, timeout=timeout_sec)
  if (r.status_code != 200):
   raise ValueError('Did not get success result from metadata server for path {}, instead got {}.'.format(path, r.status_code))
  action.add_success_fields(response=r.text)
  return r.text

def get_metadata_path ( path ) : with start_action ( action_type = u'flocker:node:agents:gce:get_metadata_path' , path = path ) as action : timeout_sec = 3 r = requests . get ( ( _METADATA_SERVER + path ) , headers = _METADATA_HEADERS , timeout = timeout_sec ) if ( r . status_code != 200 ) : raise ValueError ( 'Did not get success result from metadata server for path {}, instead got {}.' . format ( path , r . status_code ) ) action . add_success_fields ( response = r . text ) return r . text
requests a metadata path from the metadata server available within gce .