stx-config: handle exceptions for pci device checking 12/3512/1
authorJackie Huang <jackie.huang@windriver.com>
Tue, 28 Apr 2020 09:36:57 +0000 (17:36 +0800)
committerJackie Huang <jackie.huang@windriver.com>
Tue, 28 Apr 2020 09:42:06 +0000 (17:42 +0800)
Handle exceptions other than CalledProcessError for pci
device checking so that it will not fail and exit if
there are supported or unknown devices.

Issue-ID: INF-50
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Change-Id: Iff2ca63bea57e4dd9c27f5af8f27bd6bcd53013a

meta-stx/recipes-core/stx-config/files/0002-cgts-client-handle-exceptions-other-than-CalledProcessErr.patch [new file with mode: 0644]
meta-stx/recipes-core/stx-config/stx-config.bb

diff --git a/meta-stx/recipes-core/stx-config/files/0002-cgts-client-handle-exceptions-other-than-CalledProcessErr.patch b/meta-stx/recipes-core/stx-config/files/0002-cgts-client-handle-exceptions-other-than-CalledProcessErr.patch
new file mode 100644 (file)
index 0000000..4b3a4b9
--- /dev/null
@@ -0,0 +1,30 @@
+From 7ed620de2987bebfb41fe5506c1296e8d03560d5 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 28 Apr 2020 17:24:01 +0800
+Subject: [PATCH] pci.py: handle exceptions other than CalledProcessError
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ sysinv/sysinv/sysinv/sysinv/agent/pci.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/sysinv/sysinv/sysinv/sysinv/agent/pci.py b/sysinv/sysinv/sysinv/sysinv/agent/pci.py
+index 5d3a2fd..14fb0c5 100644
+--- a/sysinv/sysinv/sysinv/sysinv/agent/pci.py
++++ b/sysinv/sysinv/sysinv/sysinv/agent/pci.py
+@@ -539,6 +539,12 @@ class PCIOperator(object):
+                         LOG.info("Could not determine DPDK support for "
+                                  "NIC (vendor %s device: %s), defaulting "
+                                  "to False", vendor, device)
++                except Exception as e:
++                    dpdksupport = False
++                    LOG.debug("An exception of type %s occurred:\n%s" % (type(e), e))
++                    LOG.info("Could not determine DPDK support for "
++                             "NIC (vendor %s device: %s), defaulting "
++                             "to False", vendor, device)
+                 # determine the net directory for this device
+                 dirpcinet = self.get_pci_net_directory(a)
+-- 
+2.7.4
+
index a5e1440..89e7ff0 100644 (file)
@@ -28,6 +28,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
 SRC_URI = " \
        git://opendev.org/starlingx/config.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH} \
        file://0001-stx-config-remove-argparse-requirement-from-sysinv.patch \
+       file://0002-cgts-client-handle-exceptions-other-than-CalledProcessErr.patch \
        "
 
 DEPENDS = "\