Disable exit on error for pacemaker commands for update flow
authorSaravanan KR <skramaja@redhat.com>
Mon, 27 Feb 2017 13:46:03 +0000 (19:16 +0530)
committerSaravanan KR <skramaja@redhat.com>
Tue, 28 Feb 2017 19:14:15 +0000 (00:44 +0530)
Package update fails on compute node, when yum_update checks for
pacemaker status via systemctl command. Because exit on error (-e)
option has been enabled recently, this issue is happening. Fixing
by, executing the command only on nodes where pacemaker is enabled.
Closes-Bug: #1668266

Change-Id: I2aae4e2fdfec526c835f8967b54e1db3757bca17

extraconfig/tasks/yum_update.sh

index c66dd01..6bf415b 100755 (executable)
@@ -47,7 +47,10 @@ if [[ "$list_updates" == "" ]]; then
     exit 0
 fi
 
-pacemaker_status=$(systemctl is-active pacemaker || :)
+pacemaker_status=""
+if hiera -c /etc/puppet/hiera.yaml service_names | grep -q pacemaker; then
+    pacemaker_status=$(systemctl is-active pacemaker)
+fi
 
 # Fix the redis/rabbit resource start/stop timeouts. See https://bugs.launchpad.net/tripleo/+bug/1633455
 # and https://bugs.launchpad.net/tripleo/+bug/1634851