Ignore comments in openstack_user_config

Ignore comments in the config file to get the right host.

Change-Id: I68b444a4fe1f180c9146b6b1df743de072615861
This commit is contained in:
Marc Gariepy 2017-12-01 09:23:23 -05:00
parent 17a30dacc0
commit c753f86d17

View File

@ -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