20-use-ya-resouces-for-ec2.patch 732 B

12345678910111213141516171819202122
  1. diff --git a/contrib/python/moto/moto/ec2/models.py b/contrib/python/moto/moto/ec2/models.py
  2. --- a/contrib/python/moto/moto/ec2/models.py
  3. +++ b/contrib/python/moto/moto/ec2/models.py
  4. @@ -120,13 +120,11 @@ from .utils import (
  5. tag_filter_matches,
  6. )
  7. -INSTANCE_TYPES = json.load(
  8. - open(resource_filename(__name__, 'resources/instance_types.json'), 'r')
  9. -)
  10. -AMIS = json.load(
  11. - open(os.environ.get('MOTO_AMIS_PATH') or resource_filename(
  12. - __name__, 'resources/amis.json'), 'r')
  13. -)
  14. +# load from ya-resources
  15. +import library.python.resource as _ya_res
  16. +
  17. +INSTANCE_TYPES = json.loads(_ya_res.find('resource/instance_types.json'))
  18. +AMIS = json.loads(_ya_res.find('resource/amis.json'))
  19. def utc_date_and_time():