From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <anatoly.burakov@intel.com>
Received: from mga12.intel.com (mga12.intel.com [192.55.52.136])
 by dpdk.org (Postfix) with ESMTP id B512714EC;
 Wed,  7 Nov 2018 17:30:09 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 07 Nov 2018 08:30:08 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.54,475,1534834800"; d="scan'208";a="106692120"
Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.143])
 ([10.237.220.143])
 by orsmga002.jf.intel.com with ESMTP; 07 Nov 2018 08:30:06 -0800
To: Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org
Cc: john.mcnamara@intel.com, stable@dpdk.org
References: <d2749a0c9f18188c56e02e61c602e65ca88e099d.1541598755.git.anatoly.burakov@intel.com>
 <e6f3dbb8-8cea-515e-e872-50be49edd3d0@intel.com>
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Message-ID: <b544afca-9f01-331c-d8a6-9b85e2c1a8bd@intel.com>
Date: Wed, 7 Nov 2018 16:30:06 +0000
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <e6f3dbb8-8cea-515e-e872-50be49edd3d0@intel.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] devbind: check for lspci
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Nov 2018 16:30:10 -0000

On 07-Nov-18 4:01 PM, Ferruh Yigit wrote:
> On 11/7/2018 1:56 PM, 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.
> 
> I guess we need lspci for `--status`, bind/unbind can be done without `lspci`,
> what about adding check only display path?

IMO it's not worth respinning over that minor detail, but if you feel 
strongly about it - sure, i can do a v2 with this on display path only :)

> 
>>
>> 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()
>>
> 
> 


-- 
Thanks,
Anatoly