Skip to content

Commit

Permalink
[pcie-check] Update underlying pcieutil command and add to sudoers fi…
Browse files Browse the repository at this point in the history
…le (sonic-net#6682)

- Why I did it

As of sonic-net/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 sonic-net#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
  • Loading branch information
jleveque authored Feb 4, 2021
1 parent ca35503 commit 820d350
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/image_config/pcie-check/pcie-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions files/image_config/sudoers/sudoers
Original file line number Diff line number Diff line change
Expand Up @@ -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 *, \
Expand Down

0 comments on commit 820d350

Please sign in to comment.