10-Use-endpoints-from-ya-resouces.patch 782 B

123456789101112131415161718192021222324
  1. --- contrib/python/boto/py2/boto/regioninfo.py (index)
  2. +++ contrib/python/boto/py2/boto/regioninfo.py (working tree)
  3. @@ -115,14 +115,19 @@ def load_regions():
  4. return endpoints
  5. +def _load_resource_endpoints():
  6. + import pkgutil
  7. + return json.loads(pkgutil.get_data('boto', 'endpoints.json'))
  8. +
  9. +
  10. def _load_builtin_endpoints(_cache=_endpoints_cache):
  11. """Loads the builtin endpoints in the legacy format."""
  12. # If there's a cached response, return it
  13. if _cache:
  14. return _cache
  15. - # Load the endpoints file
  16. - endpoints = _load_json_file(boto.ENDPOINTS_PATH)
  17. + # Load the endpoints from resouces
  18. + endpoints = _load_resource_endpoints()
  19. # Build the endpoints into the legacy format
  20. resolver = BotoEndpointResolver(endpoints)