Merge pull request #1212 from JackDanger/jack/store-json-in-manifest

Revert "Merge pull request #1209 from JackDanger/jack/store-as-python"
This commit is contained in:
Jack Danger 2017-09-27 13:59:42 -07:00 committed by GitHub
commit aa9cda4bcf
6 changed files with 5 additions and 2179 deletions

View File

@ -67,7 +67,6 @@ from .exceptions import (
MotoNotImplementedError,
FilterNotImplementedError
)
from .resources.instance_types import instance_types_data
from .utils import (
EC2_RESOURCE_TO_PREFIX,
EC2_PREFIX_TO_RESOURCE,
@ -113,7 +112,7 @@ from .utils import (
)
RESOURCES_DIR = os.path.join(os.path.dirname(__file__), 'resources')
INSTANCE_TYPES = json.loads(instance_types_data)
INSTANCE_TYPES = json.load(open(os.path.join(RESOURCES_DIR, 'instance_types.json'), 'r'))
def utc_date_and_time():

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -141,20 +141,10 @@ def main():
result[instance_id] = instance_data
root_dir = subprocess.check_output(['git', 'rev-parse', '--show-toplevel']).decode().strip()
dest = os.path.join(root_dir, 'moto/ec2/resources/instance_types.py')
dest = os.path.join(root_dir, 'moto/ec2/resources/instance_types.json')
print("Writing data to {0}".format(dest))
with open(dest, 'w') as open_file:
triple_quote = '\"\"\"'
open_file.write("# Imported via `scripts/get_instance_info.py`\n")
open_file.write('instance_types_data = {}\n'.format(triple_quote))
json.dump(result,
open_file,
sort_keys=True,
indent=4,
separators=(',', ': '))
open_file.write('{}\n'.format(triple_quote))
json.dump(result, open_file)
if __name__ == '__main__':
main()

View File

@ -25,7 +25,7 @@ extras_require = {
setup(
name='moto',
version='1.1.16',
version='1.1.17',
description='A library that allows your python tests to easily'
' mock out the boto library',
author='Steve Pulec',