Merge pull request #2723 from rossjones/remove-resource-warnings
Remove ResourceWarnings when loading AMIS and INSTANCE_TYPES
This commit is contained in:
commit
152ad8b82e
@ -139,17 +139,22 @@ from .utils import (
|
|||||||
rsa_public_key_fingerprint,
|
rsa_public_key_fingerprint,
|
||||||
)
|
)
|
||||||
|
|
||||||
INSTANCE_TYPES = json.load(
|
|
||||||
open(resource_filename(__name__, "resources/instance_types.json"), "r")
|
def _load_resource(filename):
|
||||||
|
with open(filename, "r") as f:
|
||||||
|
return json.load(f)
|
||||||
|
|
||||||
|
|
||||||
|
INSTANCE_TYPES = _load_resource(
|
||||||
|
resource_filename(__name__, "resources/instance_types.json")
|
||||||
)
|
)
|
||||||
AMIS = json.load(
|
|
||||||
open(
|
AMIS = _load_resource(
|
||||||
os.environ.get("MOTO_AMIS_PATH")
|
os.environ.get("MOTO_AMIS_PATH")
|
||||||
or resource_filename(__name__, "resources/amis.json"),
|
or resource_filename(__name__, "resources/amis.json"),
|
||||||
"r",
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
OWNER_ID = "111122223333"
|
OWNER_ID = "111122223333"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user