diff options
Diffstat (limited to 'yardstick/common/utils.py')
-rw-r--r-- | yardstick/common/utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py index 473bbf540..04536190b 100644 --- a/yardstick/common/utils.py +++ b/yardstick/common/utils.py @@ -148,8 +148,14 @@ def get_neutron_client(): return neutron_client +def read_json_from_file(path): + with open(path, 'r') as f: + return jsonutils.load(f) + + def write_json_to_file(path, data, mode='w'): - write_file(path, jsonutils.dump_as_bytes(data), mode) + with open(path, mode) as f: + jsonutils.dump(data, f) def write_file(path, data, mode='w'): |