From 124ecd5d59869bad3a4f5f53f91f5b9c99051512 Mon Sep 17 00:00:00 2001 From: Kerim Gokarslan Date: Fri, 13 Oct 2017 17:29:58 -0700 Subject: NFVBENCH-40 Add pylint to tox Change-Id: Ic55a07145f27c4cfaa6df5523df3940ca4433af1 Signed-off-by: Kerim Gokarslan --- nfvbench/utils.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'nfvbench/utils.py') diff --git a/nfvbench/utils.py b/nfvbench/utils.py index fc72517..412dfae 100644 --- a/nfvbench/utils.py +++ b/nfvbench/utils.py @@ -12,17 +12,18 @@ # License for the specific language governing permissions and limitations # under the License. -import errno -import fcntl -from functools import wraps -import json -from log import LOG from math import isnan import os import re import signal import subprocess +import errno +import fcntl +from functools import wraps +import json +from log import LOG + class TimeoutError(Exception): pass @@ -30,7 +31,7 @@ class TimeoutError(Exception): def timeout(seconds=10, error_message=os.strerror(errno.ETIME)): def decorator(func): - def _handle_timeout(signum, frame): + def _handle_timeout(_signum, _frame): raise TimeoutError(error_message) def wrapper(*args, **kwargs): @@ -110,7 +111,7 @@ def get_intel_pci(nic_ports): for driver in ['i40e', 'ixgbe']: matches = re.findall(regex.format(hx=hx, driver=driver), devices) if matches: - pcis = map(lambda x: x[0], matches) + pcis = [x[0] for x in matches] if len(pcis) < 2: continue pcis.sort() -- cgit 1.2.3-korg