[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:
parent
ca355037f6
commit
820d350301
@ -16,11 +16,11 @@ function debug()
|
|||||||
|
|
||||||
function check_and_rescan_pcie_devices()
|
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)
|
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
|
||||||
|
|
||||||
if [ ! -f /usr/share/sonic/device/$PLATFORM/plugins/pcie.yaml ]; then
|
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
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ Cmnd_Alias READ_ONLY_CMDS = /bin/cat /var/log/syslog*, \
|
|||||||
/usr/local/bin/decode-syseeprom, \
|
/usr/local/bin/decode-syseeprom, \
|
||||||
/usr/local/bin/generate_dump, \
|
/usr/local/bin/generate_dump, \
|
||||||
/usr/local/bin/lldpshow, \
|
/usr/local/bin/lldpshow, \
|
||||||
|
/usr/local/bin/pcieutil *, \
|
||||||
/usr/local/bin/psuutil *, \
|
/usr/local/bin/psuutil *, \
|
||||||
/usr/local/bin/sonic-installer list, \
|
/usr/local/bin/sonic-installer list, \
|
||||||
/usr/local/bin/sfputil show *, \
|
/usr/local/bin/sfputil show *, \
|
||||||
|
Reference in New Issue
Block a user