From f736d4471eee45492fe8d1fc06c54dd91d384a62 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Wed, 19 Jun 2019 09:52:06 -0600 Subject: [PATCH] Make comparisons case insensitive If the values for the conditional checks are "true" rather than "True", they would be skipped. Let's force the variable contents to lowercase to remove the possibility of skipping the check when the value is "true" Change-Id: I9f288ee2771c0a954beee085b6df650419978422 Closes-Bug: #1833441 (cherry picked from commit 7ac8cf9c281f97b320192ca088c72a1bdf8de9f3) --- validation-scripts/all-nodes.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/validation-scripts/all-nodes.sh b/validation-scripts/all-nodes.sh index 2ab0a2b487..ad55f215c1 100755 --- a/validation-scripts/all-nodes.sh +++ b/validation-scripts/all-nodes.sh @@ -39,7 +39,7 @@ function ping_controller_ips() { fi for LOCAL_NETWORK in $networks; do in_network=$($(get_python) -c "import ipaddress; net=ipaddress.ip_network(u'$LOCAL_NETWORK'); addr=ipaddress.ip_address(u'$REMOTE_IP'); print(addr in net)") - if [[ $in_network == "True" ]]; then + if [[ "${in_network,,}" == "true" ]]; then echo "Trying to ping $REMOTE_IP for local network ${LOCAL_NETWORK}." set +e if ! ping_retry $REMOTE_IP; then @@ -125,15 +125,15 @@ function ntp_check() { fi } -if [[ $validate_gateways_icmp == "True" ]];then +if [[ "${validate_gateways_icmp,,}" == "true" ]];then ping_default_gateways fi -if [[ $validate_controllers_icmp == "True" ]];then +if [[ "${validate_controllers_icmp,,}" == "true" ]];then ping_controller_ips "$ping_test_ips" fi -if [[ $validate_fqdn == "True" ]];then +if [[ "${validate_fqdn,,}" == "true" ]];then fqdn_check fi -if [[ $validate_ntp == "True" ]];then +if [[ "${validate_ntp,,}" == "true" ]];then ntp_check fi