Fix bug with pcie-check.service (#5368)

* Change STATE_DB key (PCIE_STATUS|PCIE_DEVICES -> PCIE_DEVICES)

Signed-off-by: Petro Bratash <petrox.bratash@intel.com>

* [pcie-check.service] Add dependency on database.service

Signed-off-by: Petro Bratash <petrox.bratash@intel.com>
This commit is contained in:
Petro Bratash 2020-09-16 01:21:31 +03:00 committed by GitHub
parent da3579cf36
commit 558ec53aa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
[Unit] [Unit]
Description=Check the PCIe device presence and status Description=Check the PCIe device presence and status
After=rc.local.service After=rc.local.service database.service
[Service] [Service]
Type=simple Type=simple

View File

@ -16,7 +16,7 @@ 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 pcie-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
@ -36,8 +36,8 @@ function check_and_rescan_pcie_devices()
break break
fi fi
if [ "$PCIE_CHK_CMD" = "$EXPECTED" ]; then if [ "$(eval $PCIE_CHK_CMD)" = "$EXPECTED" ]; then
redis-cli -n 6 SET "PCIE_STATUS|PCIE_DEVICES" "PASSED" redis-cli -n 6 HSET "PCIE_DEVICES" "status" "PASSED"
debug "PCIe check passed" debug "PCIe check passed"
exit exit
else else
@ -53,7 +53,7 @@ function check_and_rescan_pcie_devices()
done done
debug "PCIe check failed" debug "PCIe check failed"
redis-cli -n 6 SET "PCIE_STATUS|PCIE_DEVICES" "FAILED" redis-cli -n 6 HSET "PCIE_DEVICES" "status" "FAILED"
} }
check_and_rescan_pcie_devices check_and_rescan_pcie_devices