aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/moto/py2/patches/20-use-ya-resouces-for-ec2.patch
blob: 927b1050038cda161be5113b9104988183e5002b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/contrib/python/moto/moto/ec2/models.py b/contrib/python/moto/moto/ec2/models.py
--- a/contrib/python/moto/moto/ec2/models.py
+++ b/contrib/python/moto/moto/ec2/models.py
@@ -120,13 +120,11 @@ from .utils import (
     tag_filter_matches,
 )
 
-INSTANCE_TYPES = json.load(
-    open(resource_filename(__name__, 'resources/instance_types.json'), 'r')
-)
-AMIS = json.load(
-    open(os.environ.get('MOTO_AMIS_PATH') or resource_filename(
-         __name__, 'resources/amis.json'), 'r')
-)
+# load from ya-resources
+import library.python.resource as _ya_res
+
+INSTANCE_TYPES = json.loads(_ya_res.find('resource/instance_types.json'))
+AMIS = json.loads(_ya_res.find('resource/amis.json'))
 
 
 def utc_date_and_time():