diff options
Diffstat (limited to 'utils/test')
-rw-r--r-- | utils/test/scripts/mongo_to_elasticsearch.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/test/scripts/mongo_to_elasticsearch.py b/utils/test/scripts/mongo_to_elasticsearch.py index 44f79efbe..caa68d8d0 100644 --- a/utils/test/scripts/mongo_to_elasticsearch.py +++ b/utils/test/scripts/mongo_to_elasticsearch.py @@ -48,9 +48,16 @@ def _get_results_from_list_of_dicts(list_of_dict_statuses, dict_indexes, expecte return test_results +def _convert_value(value): + return value if value != '' else 0 + + def _convert_duration(duration): if (isinstance(duration, str) or isinstance(duration, unicode)) and ':' in duration: hours, minutes, seconds = duration.split(":") + hours = _convert_value(hours) + minutes = _convert_value(minutes) + seconds = _convert_value(seconds) int_duration = 3600 * int(hours) + 60 * int(minutes) + float(seconds) else: int_duration = duration |