From bd3aa96b562488d009a852296559a789ed7da840 Mon Sep 17 00:00:00 2001 From: Arun Saravanan Balachandran <52521751+ArunSaravananBalachandran@users.noreply.github.com> Date: Thu, 11 Nov 2021 11:10:34 +0530 Subject: [PATCH] DellEMC: Z9332f - Fix error message during Chassis initialization (#9218) Signed-off-by: Ze Gan --- Makefile.work | 1 + .../z9332f/sonic_platform/component.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile.work b/Makefile.work index eb3073bf70e8..1ced656ef22a 100644 --- a/Makefile.work +++ b/Makefile.work @@ -274,6 +274,7 @@ SONIC_BUILD_INSTRUCTION := make \ NO_PROXY=$(no_proxy) \ SONIC_INCLUDE_SYSTEM_TELEMETRY=$(INCLUDE_SYSTEM_TELEMETRY) \ INCLUDE_DHCP_RELAY=$(INCLUDE_DHCP_RELAY) \ + INCLUDE_MACSEC=$(INCLUDE_MACSEC) \ SONIC_INCLUDE_RESTAPI=$(INCLUDE_RESTAPI) \ SONIC_INCLUDE_MUX=$(INCLUDE_MUX) \ TELEMETRY_WRITABLE=$(TELEMETRY_WRITABLE) \ diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py index c308ed291903..f652c2eccf85 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py @@ -50,9 +50,10 @@ def get_cpld2_version(): def get_ssd_version(): val = 'NA' try: - ssd_ver = subprocess.check_output(['ssdutil','-v'], text=True) - except Exception: - return val + ssd_ver = subprocess.check_output(['ssdutil', '-v'], + stderr=subprocess.STDOUT, text=True) + except (FileNotFoundError, subprocess.CalledProcessError): + pass else: version = re.search(r'Firmware\s*:(.*)',ssd_ver) if version: @@ -63,9 +64,10 @@ def get_ssd_version(): def get_pciephy_version(): val = 'NA' try: - pcie_ver = subprocess.check_output('bcmcmd "pciephy fw version"', shell=True, text=True) - except Exception: - return val + pcie_ver = subprocess.check_output(['bcmcmd', 'pciephy fw version'], + stderr=subprocess.STDOUT, text=True) + except (FileNotFoundError, subprocess.CalledProcessError): + pass else: version = re.search(r'PCIe FW loader version:\s(.*)', pcie_ver) if version: