patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] devbind: check for lspci
@ 2018-11-07 13:56 Anatoly Burakov
  2018-11-07 16:01 ` Ferruh Yigit
  2018-11-13 16:06 ` [dpdk-stable] [PATCH v2] " Anatoly Burakov
  0 siblings, 2 replies; 12+ messages in thread
From: Anatoly Burakov @ 2018-11-07 13:56 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, stable

On some distributions (such as CentOS 7) lspci may not be installed
by default, causing exceptions which are difficult to interpret.

Fix devbind script to check if lspci is installed at script startup.

Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 usertools/dpdk-devbind.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 7d564634c..74bf514c0 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -655,6 +655,13 @@ def do_arg_actions():
 
 def main():
     '''program main function'''
+    # check if lspci is installed, suppress any output
+    with open(os.devnull, 'w') as devnull:
+        ret = subprocess.call(['which', 'lspci'],
+                              stdout=devnull, stderr=devnull)
+        if ret != 0:
+            print("'lspci' not found - please install 'lspci'")
+            sys.exit(1)
     parse_args()
     check_modules()
     clear_data()
-- 
2.17.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-11-18 23:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07 13:56 [dpdk-stable] [PATCH] devbind: check for lspci Anatoly Burakov
2018-11-07 16:01 ` Ferruh Yigit
2018-11-07 16:30   ` Burakov, Anatoly
2018-11-07 18:07     ` Ferruh Yigit
2018-11-08 20:38     ` [dpdk-stable] [dpdk-dev] " Rami Rosen
2018-11-09 12:03       ` Burakov, Anatoly
2018-11-10 11:03         ` Rami Rosen
2018-11-12  9:18           ` Burakov, Anatoly
2018-11-13 16:03   ` [dpdk-stable] " Burakov, Anatoly
2018-11-13 16:06 ` [dpdk-stable] [PATCH v2] " Anatoly Burakov
2018-11-16 16:54   ` Rami Rosen
2018-11-18 23:05     ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).