tripleo-common/healthcheck/opendaylight-api
Bob Fournier a75de99d3d Bracket IPv6 address in ironic_inspector healthcheck
When using an IPv6 provisioning address, the address must be
bracketed for the ironic_inspector healthcheck.

In addition clean up other healthchecks to use this common
function when an address is used.

Closes-Bug: #1862845
Change-Id: Ifb67ebebed55e2d883a1e94cb4627f55d3a7383e
(cherry picked from commit 6c5f479616)
2020-02-26 01:10:18 +00:00

15 lines
629 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=$(wrap_ipv6 $(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/diagstatus