tripleo-common/healthcheck/opendaylight-api
Tim Rozet 9e72a429d1 Fixes ODL healthcheck URI
In the past we used index.html to ensure ODL container was healthy.
This page was provided by the GUI plugins into ODL.  Now that those
plugins are no longer supported, we need to move to a more reliable URI
path.

Related-Bug: 1751857

Change-Id: I2f33d2cf6a96005ef1d18468a8d2fcc71b17b6f8
Signed-off-by: Tim Rozet <trozet@redhat.com>
2018-04-11 15:47:18 -04:00

15 lines
626 B
Bash
Executable File

#!/bin/bash
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
file=/opt/opendaylight/etc/org.ops4j.pax.web.cfg
bind_host=$(awk -F "= *" '/^org.ops4j.pax.web.listening.addresses/ {print $2}' $file)
tls_enabled=$(awk -F "= *" '/^org.osgi.service.http.secure.enabled/ {print $2}' $file)
if [[ -z "$tls_enabled" || "$tls_enabled" != "true" ]]; then
bind_port=$(awk -F "= *" '/^org.osgi.service.http.port\s*=/ {print $2}' $file)
else
bind_port=$(awk -F "= *" '/^org.osgi.service.http.port.secure/ {print $2}' $file)
fi
healthcheck_curl http://$bind_host:$bind_port/controller/nb/v2/neutron