Dump Console log if ping fails

Console log will be useful in debugging
ping check fails.

Related-Bug: #2007357
Change-Id: I0f1603154eac85353aeb3a0c42da83c268174b05
This commit is contained in:
yatinkarel 2023-02-20 18:17:46 +05:30
parent 79a138f866
commit adcb563b18
1 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,10 @@ function ping_check_public {
fi
if ! timeout $boot_timeout sh -c "$check_command"; then
if [[ "$expected" = "True" ]]; then
# Dump Console log if ping fails
local fip=$(openstack floating ip list --floating-ip-address $ip -f value -c Port)
local server=$(openstack port show $fip -f value -c device_id)
openstack console log show $server
die $LINENO "[Fail] Couldn't ping server"
else
die $LINENO "[Fail] Could ping server"