From 7f9606ff47f03162e5d7305aaca2af5d1faecd87 Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Mon, 16 Jul 2018 09:40:11 +0200 Subject: [PATCH] Take WSGIScriptAlias into account in docker healthcheck. Some services running as vhost, as nova_placement make use of an alias in which the wsgi service is mapped. Currently, the nova_placement healthcheck has hardcoded the alias in the curl [0] request, but if this alias changes or other service modifies its from / to another, then the check will start failing again. [0] - https://github.com/openstack/tripleo-common/blob/master/healthcheck/nova-placement#L6 Change-Id: I5a325be424740e80eafd6b4abd8eb4b3111740aa Closes-Bug: #1781623 (cherry picked from commit f1a1c324fb149d40c960f1eaba650f0e8c71d91e) --- healthcheck/common.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/healthcheck/common.sh b/healthcheck/common.sh index 85eb9a186..ab55e4dc9 100644 --- a/healthcheck/common.sh +++ b/healthcheck/common.sh @@ -50,9 +50,13 @@ get_url_from_vhost () { server_name=$(awk '/ServerName/ {print $2}' $vhost_file) ssl_enabled=$(awk '/SSLEngine/ {print $2}' $vhost_file) bind_port=$(grep -h "" $vhost_file | sed 's//\1/') + wsgi_alias=$(awk '/WSGIScriptAlias/ {print $2}' $vhost_file) proto=http if [[ $ssl_enabled == "on" ]]; then proto=https fi - echo ${proto}://${server_name}:${bind_port}/ + if [[ $wsgi_alias != "/" ]]; then + wsgi_alias="${wsgi_alias}/" + fi + echo ${proto}://${server_name}:${bind_port}${wsgi_alias} }