From 57a6fb9f3955306d135c6ea10cc72b54eab8be47 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 4 Feb 2021 12:14:08 -0800 Subject: [PATCH] [pcie-check] Update underlying pcieutil command and add to sudoers file (#6682) - Why I did it As of Azure/sonic-utilities#1297, subcommands of pcieutil have changed to remove the redundant pcie- prefix. This PR adapts calling applications (pcie-check) to the new syntax. Resolves #6676 - How I did it Remove pcie- prefix from pcieutil subcommands in calling applications Also add pcieutil * to sudoers file, as pcieutil requires elevated permissions --- files/image_config/pcie-check/pcie-check.sh | 4 ++-- files/image_config/sudoers/sudoers | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/files/image_config/pcie-check/pcie-check.sh b/files/image_config/pcie-check/pcie-check.sh index 4ef2ce3047..4257a2544c 100755 --- a/files/image_config/pcie-check/pcie-check.sh +++ b/files/image_config/pcie-check/pcie-check.sh @@ -16,11 +16,11 @@ function debug() function check_and_rescan_pcie_devices() { - PCIE_CHK_CMD='sudo pcieutil pcie-check |grep "$RESULTS"' + PCIE_CHK_CMD='sudo pcieutil check | grep "$RESULTS"' PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) if [ ! -f /usr/share/sonic/device/$PLATFORM/plugins/pcie.yaml ]; then - debug "pcie.yaml does not exist! can't check pcie status!" + debug "pcie.yaml does not exist! Can't check PCIe status!" exit fi diff --git a/files/image_config/sudoers/sudoers b/files/image_config/sudoers/sudoers index aa03eda137..8ec8799c7c 100644 --- a/files/image_config/sudoers/sudoers +++ b/files/image_config/sudoers/sudoers @@ -34,6 +34,7 @@ Cmnd_Alias READ_ONLY_CMDS = /bin/cat /var/log/syslog*, \ /usr/local/bin/decode-syseeprom, \ /usr/local/bin/generate_dump, \ /usr/local/bin/lldpshow, \ + /usr/local/bin/pcieutil *, \ /usr/local/bin/psuutil *, \ /usr/local/bin/sonic-installer list, \ /usr/local/bin/sfputil show *, \