From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 52175A00C2; Mon, 9 May 2022 11:57:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BB4E407FF; Mon, 9 May 2022 11:57:22 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id AB18F4068F for ; Mon, 9 May 2022 11:57:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652090240; x=1683626240; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=AuRYN/7q22NV/RhGZdN3VXwiKXl4aBNy5qmAyexE86o=; b=E25U9z4GomWoxRA5VbYgw9+zXDJ02fPsR+TzqThkSzN/rs+2e4+HD25N JI0k58XtXJF8HR8O+5hM/jCDYEpy72fStffmF5TKn47sq+wW8f6iYM2Fs FnLYvFa5NvHG2nlXIa3wKiPaMquZ3MgujD0mFOhQBiUsfx1BmQPoaPy3T mwRRpZksHPu0Q4bBzU1KD551xQV74BjnwCpDp6lmnywMtdRcH2zEF8th2 TMNeg6x545nsPt4PffzdApTqU37ajimIDtKIBNTm7GApI0dwSSNWiLONQ 3WyXYbXPhJTfSywoQpygL7xaBicDJve0y30glql99Kbaxa3AXAQ/B11yw w==; X-IronPort-AV: E=McAfee;i="6400,9594,10341"; a="269138502" X-IronPort-AV: E=Sophos;i="5.91,211,1647327600"; d="scan'208";a="269138502" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2022 02:57:19 -0700 X-IronPort-AV: E=Sophos;i="5.91,211,1647327600"; d="scan'208";a="656335453" Received: from shwdenpg197.ccr.corp.intel.com ([10.253.109.70]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2022 02:57:17 -0700 From: Jun Dong To: dts@dpdk.org Cc: lijuan.tu@intel.com, qingx.sun@intel.com, junx.dong@intel.com Subject: [dts] [V1] nics/net_device: modify the output of getting pci Date: Mon, 9 May 2022 17:57:10 +0800 Message-Id: <20220509095710.846-1-junx.dong@intel.com> X-Mailer: git-send-email 2.33.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org About querying device pci information, the results are different on different versions of pexpect, some versions has space char in output front end, so strip the space char to improve stability. Signed-off-by: Jun Dong --- nics/net_device.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nics/net_device.py b/nics/net_device.py index 4ef755e0..f616c6d2 100644 --- a/nics/net_device.py +++ b/nics/net_device.py @@ -941,14 +941,14 @@ def get_pci_id(crb, domain_id, bus_id, devfun_id): bus_id, devfun_id, ) - out = crb.send_expect(command, "# ") + out = crb.send_expect(command, "# ").strip() vendor = out[2:] command = "cat /sys/bus/pci/devices/%s\:%s\:%s/device" % ( domain_id, bus_id, devfun_id, ) - out = crb.send_expect(command, "# ") + out = crb.send_expect(command, "# ").strip() device = out[2:] return "%s:%s" % (vendor, device) -- 2.33.1.windows.1