[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
This commit is contained in:
Joe LeVeque 2021-02-04 12:14:08 -08:00 committed by GitHub
parent ca355037f6
commit 820d350301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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 *, \