summaryrefslogtreecommitdiffstats
path: root/fuel/prototypes
diff options
context:
space:
mode:
authorStefan K. Berg <stefan.k.berg@ericsson.com>2015-04-18 21:55:35 +0200
committerStefan K. Berg <stefan.k.berg@ericsson.com>2015-04-18 21:57:22 +0200
commitf859b09dae82edb605ece5e2c4db03a48ea83a97 (patch)
treed3383f9cc013b46c6c94dae4107ca913c42af996 /fuel/prototypes
parent4b5977c92d16d1f4af9293fc874645e671674c22 (diff)
Correction of the auto-kill during deploy
Jenkins gets stuck until the safety-catch timer expires after three hours when the deploy is successfull. The result code is still correct, but it's an unnecessary delay. JIRA Change-Id: I4fae6b019174744894e223ccfd4502acece95768 Signed-off-by: Stefan K. Berg <stefan.k.berg@ericsson.com>
Diffstat (limited to 'fuel/prototypes')
-rwxr-xr-xfuel/prototypes/libvirt/deploy/deploy.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/fuel/prototypes/libvirt/deploy/deploy.sh b/fuel/prototypes/libvirt/deploy/deploy.sh
index 5d267e6..ba7f7cd 100755
--- a/fuel/prototypes/libvirt/deploy/deploy.sh
+++ b/fuel/prototypes/libvirt/deploy/deploy.sh
@@ -21,9 +21,14 @@ deployiso=${tmpdir}/deploy.iso
exit_handler() {
# Remove safety catch
- kill $killpid
+ kill -9 `ps -p $killpid -o pid --no-headers` \
+ `ps --ppid $killpid -o pid --no-headers`\
+ > /dev/null 2>&1
}
+# Set maximum allowed deploy time (default three hours)
+MAXDEPLOYTIME=${MAXDEPLOYTIME-3h}
+
####### MAIN ########
if [ "`whoami`" != "root" ]; then
@@ -59,14 +64,14 @@ if [ ! -f $deafile ]; then
fi
-# Enable safety catch at three hours
-(sleep 3h; kill $$) &
+# Enable safety catch
+echo "Enabling auto-kill if deployment exceeds $MAXDEPLOYTIME"
+(sleep $MAXDEPLOYTIME; echo "Auto-kill of deploy after a timeout of $MAXDEPLOYTIME"; kill $$) &
killpid=$!
# Enable exit handler
trap exit_handler exit
-
# Stop all VMs
for node in controller1 controller2 controller3 compute4 compute5 fuel-master
do