X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=nfvbench%2Futils.py;h=fc725176603fd25879c4e41ab8b1223b606dca1e;hb=3bc88579e9eadeafe141dc3d7fff7765486a5ee6;hp=4d9749cc72a7c54235b385ed164af8dc37b4069b;hpb=580dcb07fce694295be416a4dd4162d3be02c357;p=nfvbench.git 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,