Fix inspection for 18.10, requirements
[vpp.git] / extras / vpp_config / vpplib / VppPCIUtil.py
index 829d66a..fe64c9d 100644 (file)
@@ -14,6 +14,7 @@
 """VPP PCI Utility libraries"""
 
 import re
+import logging
 
 from vpplib.VPPUtil import VPPUtil
 
@@ -251,11 +252,12 @@ class VppPCIUtil(object):
 
         :param devices: A list of devices
         :param show_interfaces: show the kernel information
+        :param show_header: Display the header if true
         :type devices: dict
         :type show_interfaces: bool
+        :type show_header: bool
         """
 
-
         if show_interfaces:
             header = "{:15} {:25} {:50}".format("PCI ID",
                                                 "Kernel Interface(s)",
@@ -265,8 +267,7 @@ class VppPCIUtil(object):
                                           "Description")
         dashseparator = ("-" * (len(header) - 2))
 
-
-        if show_header == True:
+        if show_header is True:
             print header
             print dashseparator
         for dit in devices.items():
@@ -298,7 +299,6 @@ class VppPCIUtil(object):
         :type device_id: string
         """
 
-
         rootdir = node['rootdir']
         dpdk_script = rootdir + DPDK_SCRIPT
         cmd = dpdk_script + ' -u ' + ' ' + device_id
@@ -319,6 +319,7 @@ class VppPCIUtil(object):
         :type node: dict
         :type driver: string
         :type device_id: string
+        :returns ret: Command return code
         """
 
         rootdir = node['rootdir']
@@ -326,5 +327,9 @@ class VppPCIUtil(object):
         cmd = dpdk_script + ' -b ' + driver + ' ' + device_id
         (ret, stdout, stderr) = VPPUtil.exec_command(cmd)
         if ret != 0:
-            raise RuntimeError('{} failed on node {} {} {}'.format(
+            logging.error('{} failed on node {}'.format(
                 cmd, node['host'], stdout, stderr))
+            logging.error('{} {}'.format(
+                stdout, stderr))
+
+        return ret