summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d58360c)
Address python lint complaints about unused imports.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
import argparse
from glob import glob
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
from os.path import join as path_join
# The PCI base class for all devices
# of unbinding those devices
if driver in dpdk_drivers:
filename = "/sys/bus/pci/devices/%s/driver_override" % dev_id
# of unbinding those devices
if driver in dpdk_drivers:
filename = "/sys/bus/pci/devices/%s/driver_override" % dev_id
- if os.path.exists(filename):
try:
f = open(filename, "w")
except:
try:
f = open(filename, "w")
except:
# 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
# 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):
try:
f = open(filename, "w")
except:
try:
f = open(filename, "w")
except:
# 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.
# 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:
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: