aboutsummaryrefslogtreecommitdiffstats
path: root/nfvbench/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'nfvbench/utils.py')
-rw-r--r--nfvbench/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nfvbench/utils.py b/nfvbench/utils.py
index b92c75e..06f643c 100644
--- a/nfvbench/utils.py
+++ b/nfvbench/utils.py
@@ -166,7 +166,7 @@ def parse_flow_count(flow_count):
try:
flow_count = int(flow_count)
except ValueError:
- raise Exception("Unknown flow count format '{}'".format(input_fc))
+ raise Exception("Unknown flow count format '{}'".format(input_fc)) from ValueError
return flow_count * multiplier
@@ -190,8 +190,8 @@ class RunLock(object):
try:
self._fd = os.open(self._path, os.O_CREAT)
fcntl.flock(self._fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
- except (OSError, IOError):
- raise Exception('Other NFVbench process is running. Please wait')
+ except (OSError, IOError) as e:
+ raise Exception('Other NFVbench process is running. Please wait') from e
def __exit__(self, *args):
fcntl.flock(self._fd, fcntl.LOCK_UN)