[v2,3/6] dpdk-devbind: fix python lint warnings for imports
diff mbox series

Message ID 20201104070350.28224-4-stephen@networkplumber.org
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • dpdk-devbind: python lint cleanups
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Nov. 4, 2020, 7:03 a.m. UTC
Address python lint complaints about unused imports.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 usertools/dpdk-devbind.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 3a27641d0e08..4148b66b6841 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -9,7 +9,7 @@ 
 import argparse
 
 from glob import glob
-from os.path import exists, abspath, dirname, basename
+from os.path import exists, basename
 from os.path import join as path_join
 
 # The PCI base class for all devices
@@ -342,7 +342,7 @@  def bind_one(dev_id, driver, force):
     # of unbinding those devices
     if driver in dpdk_drivers:
         filename = "/sys/bus/pci/devices/%s/driver_override" % dev_id
-        if os.path.exists(filename):
+        if exists(filename):
             try:
                 f = open(filename, "w")
             except:
@@ -405,7 +405,7 @@  def bind_one(dev_id, driver, force):
     # Before unbinding it, overwrite driver_override with empty string so that
     # the device can be bound to any other driver
     filename = "/sys/bus/pci/devices/%s/driver_override" % dev_id
-    if os.path.exists(filename):
+    if exists(filename):
         try:
             f = open(filename, "w")
         except:
@@ -473,7 +473,7 @@  def bind_all(dev_list, driver, force=False):
     # that are not bound to any other driver could be bound even if no one has
     # asked them to. hence, we check the list of drivers again, and see if
     # some of the previously-unbound devices were erroneously bound.
-    if not os.path.exists("/sys/bus/pci/devices/%s/driver_override" % d):
+    if not exists("/sys/bus/pci/devices/%s/driver_override" % d):
         for d in devices.keys():
             # skip devices that were already bound or that we know should be bound
             if "Driver_str" in devices[d] or d in dev_list: