make mongo_to_elasticsearch.py skip resolve-failed results 85/20285/1
authorSerenaFeng <feng.xiaowei@zte.com.cn>
Mon, 5 Sep 2016 02:11:21 +0000 (10:11 +0800)
committerSerenaFeng <feng.xiaowei@zte.com.cn>
Mon, 5 Sep 2016 02:11:21 +0000 (10:11 +0800)
commit581921cea95147f3af8abab7df14bb9375fde0fc
tree8e272286fdbd1a5f81506f43cdd62eff915533de
parent9f410cf990048e6388d6f41289ebe6cd70185fc8
make mongo_to_elasticsearch.py skip resolve-failed results

mongo_to_elasticsearch.py exit when encounter can-not-be-parsed results,
for example:
File "mongo_to_elasticsearch.py", line 58, in _convert_duration
hours, minutes, seconds = duration.split(":")
ValueError: need more than 2 values to unpack

File "mongo_to_elasticsearch.py", line 228, in modify_functest_odl
test_statuses = _get_dicts_from_list(testcase, testcase['details']['details'],
KeyError: 'details'

change the logic, try...Except the Exception, logger it as error, then
continue processing the rest results

Change-Id: I18facd457ba3e8f661f5c9a1da1e6c200af6fc4e
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
utils/test/scripts/mongo_to_elasticsearch.py