sysinv-api script to return ERROR

Remove NOT_RUNNING return in case sysinv-api pid is still active but
fails to ping. This scenario can happen in case sysinv-api is manually
killed and SM triggers a start.
Also, on the new routine to check if sysinv-api is properly replying,
return ERROR instead of NOT_RUNNING for SM consistency.

Testing:
Tested double sysinv-api kill withing 90 seconds as per SM
configuration. Upon first sysinv-api kill it should be restarted,
upon second sysinv-api kill, if done within 90 seconds, a swact is
triggered. Also verified that sysinv-api request routine was engaged.
Also tested AIO-DX boostrap, manual swact via host-swact and patch
application. After boostrap and patch application tested double
sysinv-api kill and manual swact.

Other fix related to this issue was addressed by this change:
https://review.opendev.org/c/starlingx/stx-puppet/+/783980

Closes-Bug: 1893669
Signed-off-by: Adriano Oliveira <adriano.oliveira@windriver.com>
Change-Id: I1b1ab0560237f602dadf074331f6a165d12330c7
(cherry picked from commit 8cc522bed5)
This commit is contained in:
Adriano Oliveira 2021-04-13 19:21:54 -04:00
parent 64cf883049
commit 7d38399521
1 changed files with 4 additions and 4 deletions

View File

@ -225,7 +225,7 @@ sysinv_api_request () {
rc=$?
if [ $rc -ne 0 ]; then
ocf_log err "Failed to connect to the System Inventory Service (sysinv-api): $rc"
return $OCF_NOT_RUNNING
return $OCF_ERR_GENERIC
else
return $OCF_SUCCESS
fi
@ -239,7 +239,7 @@ sysinv_api_request () {
return $OCF_SUCCESS
fi
ocf_log err "Unable to communicate with the System Inventory Service (sysinv-api)"
return $OCF_NOT_RUNNING
return $OCF_ERR_GENERIC
fi
}
@ -303,8 +303,8 @@ sysinv_api_start () {
else
sysinv_api_request_with_attempt
rc=$?
return ${rc}
fi
return ${rc}
fi
if [ ${OCF_RESKEY_dbg} = "true" ] ; then
@ -347,7 +347,7 @@ sysinv_api_start () {
ocf_log info "Inventory Service (${OCF_RESKEY_binary}) started (pid=${pid})"
else
ocf_log err "Inventory Service (${OCF_RESKEY_binary}) failed to start (rc=${rc})"
rc=${OCF_NOT_RUNNING}
rc=${OCF_ERR_GENERIC}
fi
return ${rc}