Moves the swift start/stop into the common_functions.sh file
authormarios <marios@redhat.com>
Wed, 2 Mar 2016 16:31:51 +0000 (18:31 +0200)
committermarios <marios@redhat.com>
Wed, 2 Mar 2016 16:31:51 +0000 (18:31 +0200)
Since swift isn't managed by pacemaker we need to manually (systemctl)
stop and start the swift services. This moves the duplicate blocks for
start/stop into a common function (we already include that
pacemaker_common_functions.sh here so may as well)

Change-Id: Ic4f23212594c1bf9edc39143bf60c7f6d648fd1d

extraconfig/tasks/major_upgrade_controller_pacemaker_1.sh
extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh
extraconfig/tasks/pacemaker_common_functions.sh

index dcd4be9..bf2ee33 100755 (executable)
@@ -30,11 +30,7 @@ if [ "$(hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid)" = "$(facter hostname)
 fi
 
 # Swift isn't controled by pacemaker
-for S in openstack-swift-account-auditor openstack-swift-account-reaper openstack-swift-account-replicator openstack-swift-account \
-openstack-swift-container-auditor openstack-swift-container-replicator openstack-swift-container-updater openstack-swift-container \
-openstack-swift-object-auditor openstack-swift-object-replicator openstack-swift-object-updater openstack-swift-object openstack-swift-proxy; do
-    systemctl stop $S
-done
+systemctl_swift stop
 
 tstart=$(date +%s)
 while systemctl is-active pacemaker; do
index 0b92a3b..10bea57 100755 (executable)
@@ -64,8 +64,4 @@ if [ "$(hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid)" = "$(facter hostname)
 fi
 
 # Swift isn't controled by heat
-for S in openstack-swift-account-auditor openstack-swift-account-reaper openstack-swift-account-replicator openstack-swift-account \
-openstack-swift-container-auditor openstack-swift-container-replicator openstack-swift-container-updater openstack-swift-container \
-openstack-swift-object-auditor openstack-swift-object-replicator openstack-swift-object-updater openstack-swift-object openstack-swift-proxy; do
-    systemctl start $S
-done
+systemctl_swift start
index 32d06c4..ee3216e 100755 (executable)
@@ -37,3 +37,12 @@ function check_resource {
 function echo_error {
     echo "$@" | tee /dev/fd2
 }
+
+function systemctl_swift {
+    action=$1
+    for S in openstack-swift-account-auditor openstack-swift-account-reaper openstack-swift-account-replicator openstack-swift-account \
+             openstack-swift-container-auditor openstack-swift-container-replicator openstack-swift-container-updater openstack-swift-container \
+             openstack-swift-object-auditor openstack-swift-object-replicator openstack-swift-object-updater openstack-swift-object openstack-swift-proxy; do
+                systemctl $action $S
+    done
+}