From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by dpdk.org (Postfix) with ESMTP id 703E22B94; Fri, 16 Nov 2018 17:55:03 +0100 (CET) Received: by mail-oi1-f194.google.com with SMTP id w13so7577607oiw.9; Fri, 16 Nov 2018 08:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M+bCguMonNrh4c/YOeylllokp3UQcpZs/jgqNPvYA5w=; b=WazRadTL9fcuCVdnyK4YuVwGvBbmm+n8mvT2xYIqT4dVBCd+saR9ERNih0HEFSwPhc CCJRdEM5ncXGBy1Qo1ivh5KSKWYNg3xYm73HrI837Tce6P4bwBldqsPLEDoVCic6Qwjh o3RGV41Obta9nf+qvd5GBg0iBGE9nzMT9xk9/rBWtBGqiI6OFk/UVJo5JKZ9Ahl+J7iz e0vHiEnJ5797OH0kZ0xRcuQcxt5JgsBiWC+tn8C2nxRWoQyoKrbe3NY91D/9GXiAgF0g MlKMHlriUykJCWbHnqXeGRuSCvGECFpYEijWtuKppYfqHdUKXX0paMz/V7EYj96wr2dr m7cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M+bCguMonNrh4c/YOeylllokp3UQcpZs/jgqNPvYA5w=; b=PU9gaAyTOuAOT/2b8OZr2qiP2zwwVRxerjCkHausJppWkc2LrRKRt4ePPdmqMRBnrS TMvDMgV5ogT4lj89uvn+8JYYMMcOnSOumpixqFmYdDIeltnVMAt/teRs3Cp7pxUR+zva C1qzp1Ww5HaH0c/Mwdk6unoDbzM30cR08OSzOztyW4vynn/gCnj3VXsVrJXEXjV6HW4K PTE7luJ7HX6SYZg8ymGGV4zUNf8qB+cVvVLH62/O+eUrLTxSuegL71/cJRwRjyfGgwMg eDD4PZteegMmA0XZxORdyngzZdPGoq7RjEKjaY7f+OcaJvqnfQKv4yCDHkc087gMZKAt a8Eg== X-Gm-Message-State: AGRZ1gKytXpxIbsHtndAhYhOZD2WkpYJMRFEJW+VjEOoUUujbyK9chek uQwBYjYPye1zixCg3p4/gTKaNbjZvN+peLJeGnV/af/F X-Google-Smtp-Source: AJdET5f3GCEesUb0orKHXUeiXuQS1IE5sBHRn/NYVIYzPhhcNldEU0SCA+23aqQPdt1UwCh4uCGQ5DR+cSyoFWeBDRQ= X-Received: by 2002:aca:5f85:: with SMTP id t127-v6mr1463775oib.103.1542387302798; Fri, 16 Nov 2018 08:55:02 -0800 (PST) MIME-Version: 1.0 References: <9b28e77a26d11b3cb8d063ea5949f231b0f9830d.1542124966.git.anatoly.burakov@intel.com> In-Reply-To: <9b28e77a26d11b3cb8d063ea5949f231b0f9830d.1542124966.git.anatoly.burakov@intel.com> From: Rami Rosen Date: Fri, 16 Nov 2018 18:54:50 +0200 Message-ID: To: "Burakov, Anatoly" Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] devbind: check for lspci X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 16:55:03 -0000 Reviewed-by: Rami Rosen On Tue, 13 Nov 2018 at 18:06, Anatoly Burakov wrote: > > 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 > --- > > Notes: > v2: correct package name to "pciutils" > > usertools/dpdk-devbind.py | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py > index 7d564634c..40dc28a7d 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() > -- > 2.17.1