From: Jackie Huang Date: Tue, 28 Apr 2020 09:36:57 +0000 (+0800) Subject: stx-config: handle exceptions for pci device checking X-Git-Tag: bronze-rc0~60 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=764d0537467c324bfaeb9342f9f10705ed7145af;p=pti%2Frtp.git stx-config: handle exceptions for pci device checking 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 Change-Id: Iff2ca63bea57e4dd9c27f5af8f27bd6bcd53013a --- 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 index 0000000..4b3a4b9 --- /dev/null +++ b/meta-stx/recipes-core/stx-config/files/0002-cgts-client-handle-exceptions-other-than-CalledProcessErr.patch @@ -0,0 +1,30 @@ +From 7ed620de2987bebfb41fe5506c1296e8d03560d5 Mon Sep 17 00:00:00 2001 +From: Jackie Huang +Date: Tue, 28 Apr 2020 17:24:01 +0800 +Subject: [PATCH] pci.py: handle exceptions other than CalledProcessError + +Signed-off-by: Jackie Huang +--- + 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 + diff --git a/meta-stx/recipes-core/stx-config/stx-config.bb b/meta-stx/recipes-core/stx-config/stx-config.bb index a5e1440..89e7ff0 100644 --- a/meta-stx/recipes-core/stx-config/stx-config.bb +++ b/meta-stx/recipes-core/stx-config/stx-config.bb @@ -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 = "\