diff options
author | JordonPhillips <phjordon@amazon.com> | 2016-12-29 09:55:24 -0800 |
---|---|---|
committer | JordonPhillips <phjordon@amazon.com> | 2016-12-29 09:55:24 -0800 |
commit | cb68db6fbb1b28e22d13f27eabe6d9f797486840 (patch) | |
tree | bf1cbaf4b00fd6e9f6b9dffca77b19455bd88401 /boto/regioninfo.py | |
parent | 6bb7cc522be199d79e34350741fd149590b83690 (diff) | |
download | boto-cb68db6fbb1b28e22d13f27eabe6d9f797486840.tar.gz |
Rename json loader to be more descriptive
Diffstat (limited to 'boto/regioninfo.py')
-rw-r--r-- | boto/regioninfo.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/boto/regioninfo.py b/boto/regioninfo.py index ac98eeea..8d40ac27 100644 --- a/boto/regioninfo.py +++ b/boto/regioninfo.py @@ -38,6 +38,18 @@ def load_endpoint_json(path): :returns: The loaded data """ + return _load_json_file(path) + + +def _load_json_file(path): + """ + Loads a given JSON file & returns it. + + :param path: The path to the JSON file + :type path: string + + :returns: The loaded data + """ with open(path, 'r') as endpoints_file: return json.load(endpoints_file) @@ -82,16 +94,16 @@ def load_regions(): :rtype: dict """ # Load the defaults first. - endpoints = load_endpoint_json(boto.ENDPOINTS_PATH) + endpoints = _load_json_file(boto.ENDPOINTS_PATH) additional_data = None # Try the ENV var. If not, check the config file. if os.environ.get('BOTO_ENDPOINTS'): additional_path = os.environ['BOTO_ENDPOINTS'] - additional_data = load_endpoint_json(additional_path) + additional_data = _load_json_file(additional_path) elif boto.config.get('Boto', 'endpoints_path'): additional_path = boto.config.get('Boto', 'endpoints_path') - additional_data = load_endpoint_json(additional_path) + additional_data = _load_json_file(additional_path) # If there's a file provided, we'll load it as well. resolver = BotoEndpointResolver(endpoints, additional_data) |