Bugfix: There is an exception when crawling Yardstick results 57/63057/2
authorxudan <xudan16@huawei.com>
Sun, 30 Sep 2018 06:44:07 +0000 (02:44 -0400)
committerGeorg Kunz <georg.kunz@ericsson.com>
Mon, 1 Oct 2018 12:03:57 +0000 (12:03 +0000)
commit76947950b0196367768068ae31f85ca175b672fb
tree8be61df2626beb04910ed549898c6ae94100ac59
parentdcd16973180f55be907c79f074040b498c3088b9
Bugfix: There is an exception when crawling Yardstick results

If there is no pod.yaml, the results data looks like,
{"status": 2, "result": "[Errno 2] No such file or directory: u'/home/opnfv/userconfig/pre_config/pod.yaml'"}

It will get an exception when reading value from file,
File "/usr/local/lib/python2.7/dist-packages/dovetail/report.py", line 327, in crawl_from_file
criteria = data['result']['criteria']
TypeError: string indices must be integers

https://build.opnfv.org/ci/view/dovetail/job/dovetail-apex-baremetal-default-mandatory-master/52/console

Change-Id: I73ca3e5ae73433a2dc139789df4d67e8c583be08
Signed-off-by: xudan <xudan16@huawei.com>
dovetail/report.py