[Qa-jenkins-scm] [jenkins.debian.net] 01/01: fix logic to detect network failures

Holger Levsen holger at moszumanska.debian.org
Wed Sep 9 08:57:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit e4c788b026c60a1f58d6386b276a90d8d2aae325
Author: Holger Levsen <holger at layer-acht.org>
Date:   Wed Sep 9 10:56:32 2015 +0200

    fix logic to detect network failures
---
 bin/schroot-create.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/schroot-create.sh b/bin/schroot-create.sh
index 427dc2a..e67cd28 100755
--- a/bin/schroot-create.sh
+++ b/bin/schroot-create.sh
@@ -102,7 +102,7 @@ robust_chroot_apt() {
 	sudo chroot $CHROOT_TARGET apt-get $@ | tee $TMPLOG
 	RESULT=$(egrep 'Failed to fetch.*(Unable to connect to|Connection failed|Size mismatch|Cannot initiate the connection to|Bad Gateway)' $TMPLOG)
 	set -e
-	if [ -z "$RESULT" ] ; then
+	if [ ! -z "$RESULT" ] ; then
 		echo "$(date -u) - 'apt-get $@' failed, sleeping 5min before retrying..."
 		sleep 5m
 		sudo chroot $CHROOT_TARGET apt-get $@
@@ -119,7 +119,7 @@ bootstrap() {
 	sudo debootstrap $SUITE $CHROOT_TARGET $MIRROR | tee $TMPLOG
 	RESULT=$(egrep "E: Couldn't download packages" $TMPLOG)
 	set -e
-	if [ -z "$RESULT" ] ; then
+	if [ ! -z "$RESULT" ] ; then
 		echo "$(date -u) - initial debootstrap failed, sleeping 5min before retrying..."
 		sudo rm -rf --one-file-system $CHROOT_TARGET
 		sleep 5m

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list