Deployments using external LB will file like this:
deploy_stderr: |
+ RESTART_FOLDER=/var/lib/tripleo/pacemaker-restarts
+ [[ -d /var/lib/tripleo/pacemaker-restarts ]]
++ systemctl is-active haproxy
+ haproxy_status=unknown
deploy_status_code: 3
openstack software deployment show 4f339ca4-7600-4ca0-b0ef-f798bc47b6cf
The reason is that via https://review.openstack.org/#/c/393644/ we
introducted the haproxy restart like this:
haproxy_status=$(systemctl is-active haproxy)
if [ "$haproxy_status" = "active" ]; then
systemctl reload haproxy
fi
The problem is that if haproxy is not running/installed systemctl
is-active can fail and the script will terminate with an error return
code. Let's just move the call inside the if so the script does not fail
in case haproxy is not there.
The snippet before the change (on a system without haproxy installed):
[root@mrg-09 tmp]# ./test.sh
++ systemctl is-active haproxy
+ haproxy_status=unknown
[root@mrg-09 tmp]# echo $?
3
After this change:
[root@mrg-09 tmp]# ./test.sh
++ systemctl is-active haproxy
+ '[' unknown = active ']'
[root@mrg-09 tmp]# echo $?
0
Change-Id: I837c63a9dbcde8c922f843c442974fa79cf1eede
Closes-Bug: #1641904
(cherry picked from commit bb3c742e36ac86ed41a7705aec05adbaf62098f6)
Reviewed: https:/ /review. openstack. org/398040 /git.openstack. org/cgit/ openstack/ tripleo- heat-templates/ commit/ ?id=1db6d09074d b64b2cdf511bd06 eb9274d5344418
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 1db6d09074db64b 2cdf511bd06eb92 74d5344418
Author: Michele Baldessari <email address hidden>
Date: Tue Nov 15 11:25:38 2016 +0100
Fix external Load Balancer deployment
Deployments using external LB will file like this: stderr: | FOLDER= /var/lib/ tripleo/ pacemaker- restarts tripleo/ pacemaker- restarts ]] status= unknown status_ code: 3 7600-4ca0- b0ef-f798bc47b6 cf
deploy_
+ RESTART_
+ [[ -d /var/lib/
++ systemctl is-active haproxy
+ haproxy_
deploy_
openstack software deployment show 4f339ca4-
The reason is that via https:/ /review. openstack. org/#/c/ 393644/ we status= $(systemctl is-active haproxy)
introducted the haproxy restart like this:
haproxy_
if [ "$haproxy_status" = "active" ]; then
systemctl reload haproxy
fi
The problem is that if haproxy is not running/installed systemctl
is-active can fail and the script will terminate with an error return
code. Let's just move the call inside the if so the script does not fail
in case haproxy is not there.
The snippet before the change (on a system without haproxy installed): status= unknown
[root@mrg-09 tmp]# ./test.sh
++ systemctl is-active haproxy
+ haproxy_
[root@mrg-09 tmp]# echo $?
3
After this change:
[root@mrg-09 tmp]# ./test.sh
++ systemctl is-active haproxy
+ '[' unknown = active ']'
[root@mrg-09 tmp]# echo $?
0
Change-Id: I837c63a9dbcde8 c922f843c442974 fa79cf1eede d41a7705aec05ad baf62098f6)
Closes-Bug: #1641904
(cherry picked from commit bb3c742e36ac86e