]> git.droids-corp.org - dpdk.git/blobdiff - usertools/dpdk-devbind.py
usertools: remove devbind module search corner cases
[dpdk.git] / usertools / dpdk-devbind.py
index 7dc8e48a263b230d8dfec3d7ad852dc1c0789848..2d99e9d8270209732a92ca129d3f94b1f7cf5a76 100755 (executable)
@@ -161,12 +161,11 @@ def find_module(mod):
 
     # check using depmod
     try:
-        depmod_out = check_output(["modinfo", "-n", mod],
-                                  stderr=subprocess.STDOUT).lower()
-        if "error" not in depmod_out:
-            path = depmod_out.strip()
-            if exists(path):
-                return path
+        with open(os.devnull, "w") as fnull:
+            path = check_output(["modinfo", "-n", mod], stderr=fnull).strip()
+
+        if path and exists(path):
+            return path
     except:  # if modinfo can't find module, it fails, so continue
         pass