Fix ironic-pxe healthcheck.

When the /run_command file is not found on the
container using the ironic-pxe image, the health
status displays unhealthy even though it's not
true. The reason is because grep can't find
the file and the error makes the whole healthcheck
fail.
This patch redirects the error output so the command
doesn't fail, but the conditional is properly
evaluated.

Change-Id: Ia6141f5499f34cd10618378f448598f74aca6273
Closes-Bug: #1803153
This commit is contained in:
Jose Luis Franco Arza 2018-11-13 17:20:14 +01:00 committed by Jose Luis Franco
parent 7caf2065ba
commit 67ed5a0488
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
if grep "/httpd " /run_command ; then
if grep "/httpd " /run_command 2>/dev/null ; then
bind_host=127.0.0.1
bind_port=$(grep "^Listen " /etc/httpd/conf.d/10-ipxe_vhost.conf | awk '{print $2}')
protocol=http