From c753f86d1717030b3023e627b356dd6b46496240 Mon Sep 17 00:00:00 2001 From: Marc Gariepy Date: Fri, 1 Dec 2017 09:23:23 -0500 Subject: [PATCH] Ignore comments in openstack_user_config Ignore comments in the config file to get the right host. Change-Id: I68b444a4fe1f180c9146b6b1df743de072615861 --- leap-upgrades/lib/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leap-upgrades/lib/functions.sh b/leap-upgrades/lib/functions.sh index 5454b91b..67234cf4 100644 --- a/leap-upgrades/lib/functions.sh +++ b/leap-upgrades/lib/functions.sh @@ -218,7 +218,7 @@ function get_openstack_release_file { # Get openstack_user_config.yml file path USER_CONFIG_FILE=$(find /etc/ -name '*_user_config.yml' -o -name 'os-infra_hosts.yml') # Get IP of os_infra node - INFRA_IP=$(sed -n -e '/infra_hosts/, /ip:/ p' ${USER_CONFIG_FILE} | awk '/ip:/ {print $2; exit}') + INFRA_IP=$(sed -n -e '/^#/d' -e '/infra_hosts/, /ip:/ p' ${USER_CONFIG_FILE} | awk '/ip:/ {print $2; exit}') if [[ -z "${INFRA_IP}" ]]; then failure "Could not find infra ip to get openstack-release file. Exiting.." exit 99