summaryrefslogtreecommitdiff
path: root/usertools
diff options
context:
space:
mode:
authorAnatoly Burakov <anatoly.burakov@intel.com>2018-11-13 16:06:26 +0000
committerThomas Monjalon <thomas@monjalon.net>2018-11-19 00:03:52 +0100
commit1a5a9cb32a93da47fa6aa0da8407337feaf901f8 (patch)
tree54aadfb68c858230a6ad3fcc913e5e8efd4f09db /usertools
parent5a5f4676eb93fa410b56df060a6d0c7603469f81 (diff)
downloaddpdk-next-eventdev-1a5a9cb32a93da47fa6aa0da8407337feaf901f8.zip
dpdk-next-eventdev-1a5a9cb32a93da47fa6aa0da8407337feaf901f8.tar.gz
dpdk-next-eventdev-1a5a9cb32a93da47fa6aa0da8407337feaf901f8.tar.xz
usertools: check for lspci dependency
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> Reviewed-by: Rami Rosen <roszenrami@gmail.com>
Diffstat (limited to 'usertools')
-rwxr-xr-xusertools/dpdk-devbind.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 7d56463..40dc28a 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 'pciutils'")
+ sys.exit(1)
parse_args()
check_modules()
clear_data()