diff options
author | Kerim Gokarslan <kgokarsl@cisco.com> | 2017-09-21 15:30:43 -0700 |
---|---|---|
committer | ahothan <ahothan@cisco.com> | 2017-10-20 00:37:13 -0700 |
commit | 3bc88579e9eadeafe141dc3d7fff7765486a5ee6 (patch) | |
tree | ace763fd2eea217a663a73ea3491cb9f97e71aef /nfvbench/utils.py | |
parent | 580dcb07fce694295be416a4dd4162d3be02c357 (diff) |
NFVBENCH-32 Check nan result values before integer casting
Change-Id: Ia675672b40f93d7503ebe5a355896a084e3d0cbf
Signed-off-by: Kerim Gokarslan <kgokarsl@cisco.com>
Diffstat (limited to 'nfvbench/utils.py')
-rw-r--r-- | nfvbench/utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nfvbench/utils.py b/nfvbench/utils.py index 4d9749c..fc72517 100644 --- a/nfvbench/utils.py +++ b/nfvbench/utils.py @@ -17,6 +17,7 @@ import fcntl from functools import wraps import json from log import LOG +from math import isnan import os import re import signal @@ -141,6 +142,10 @@ def parse_flow_count(flow_count): return flow_count * multiplier +def cast_integer(value): + return int(value) if not isnan(value) else value + + class RunLock(object): """ Attempts to lock file and run current instance of NFVbench as the first, |