From adcb563b185416451da419186a8d7773ffb6b913 Mon Sep 17 00:00:00 2001 From: yatinkarel Date: Mon, 20 Feb 2023 18:17:46 +0530 Subject: [PATCH] Dump Console log if ping fails Console log will be useful in debugging ping check fails. Related-Bug: #2007357 Change-Id: I0f1603154eac85353aeb3a0c42da83c268174b05 --- functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/functions b/functions index 0550a094..665e0695 100644 --- a/functions +++ b/functions @@ -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"