diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-02-28 22:50:40 -0800 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2017-03-08 07:53:24 +0000 |
commit | 7541c9613e62ca0b295f6111c67b0956c2fd7403 (patch) | |
tree | a12de8b9fa6657233355b8cb876ed6e6a93e35e9 /dashboard/Yardstick-TC010-1456495940503 | |
parent | 3410e13b059e0b86ce89a791608ce90753009906 (diff) |
Bugfix: don't use jsonutils.load, use loads()
It looks like jsonutils.load uses a codec reader
to read from the file, but we already are using
Python 3.5 open() which should already do the UTF-8
decode itself.
return json.load(codecs.getreader(encoding)(fp), **kwargs)C
When we use jsonutils.load() we get a TypeErorr when concating
str and bytes
2017-02-28 16:42:38,431 yardstick.cmd.commands.task task.py:61 ERROR
Traceback (most recent call last):
File "yardstick/yardstick/cmd/commands/task.py", line 58, in do_start
self._finish()
File "yardstick/yardstick/cmd/commands/task.py", line 69, in _finish
result = read_json_from_file(self.output_file).get('result')
File "yardstick/yardstick/common/utils.py", line 136, in read_json_from_file
return jsonutils.load(f)
File "yardstick_venv3/lib/python3.5/site-packages/oslo_serialization/jsonutils.py", line 241, in load
return json.load(codecs.getreader(encoding)(fp), **kwargs)
File "/usr/lib/python3.5/json/__init__.py", line 265, in load
return loads(fp.read(),
File "yardstick_venv3/lib/python3.5/codecs.py", line 497, in read
data = self.bytebuffer + newdata
TypeError: can't concat bytes to str
So switch back to jsonutils.loads() which does nothing if the
bytes are already decoded.
JIRA: YARDSTICK-584
Change-Id: I36acfda3df2b46d16a87f2741a04fe7ee8e8d89b
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'dashboard/Yardstick-TC010-1456495940503')
0 files changed, 0 insertions, 0 deletions