diff --git a/keystone/common/utils.py b/keystone/common/utils.py index 9e6d9e2f81..096e077b57 100644 --- a/keystone/common/utils.py +++ b/keystone/common/utils.py @@ -86,26 +86,6 @@ def flatten_dict(d, parent_key=''): return dict(items) -def read_cached_file(filename, cache_info, reload_func=None): - """Read from a file if it has been modified. - - :param cache_info: dictionary to hold opaque cache. - :param reload_func: optional function to be called with data when - file is reloaded due to a modification. - - :returns: data from file. - - """ - mtime = os.path.getmtime(filename) - if not cache_info or mtime != cache_info.get('mtime'): - with open(filename) as fap: - cache_info['data'] = fap.read() - cache_info['mtime'] = mtime - if reload_func: - reload_func(cache_info['data']) - return cache_info['data'] - - class SmarterEncoder(jsonutils.json.JSONEncoder): """Help for JSON encoding dict-like objects."""