BBlack has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/256148

Change subject: puppet-run: do not let apt failures block agent
......................................................................

puppet-run: do not let apt failures block agent

Change-Id: I7e3673ccfebdaad0a82848e3bb78b803cdd8e4d7
---
M modules/base/files/puppet/puppet-run
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/48/256148/1

diff --git a/modules/base/files/puppet/puppet-run 
b/modules/base/files/puppet/puppet-run
index 30eb617..c2b7e19 100644
--- a/modules/base/files/puppet/puppet-run
+++ b/modules/base/files/puppet/puppet-run
@@ -1,5 +1,6 @@
 #!/bin/bash
 
+# Bail out early if any of these first commands exit abnormally
 set -e
 
 # We pass show-diff, show the log may be sensitive,
@@ -10,8 +11,11 @@
 # Check this before apt-get update, so that our update doesn't screw up
 # package installs in a running (manual and/or initial install) puppet run
 PUPPETLOCK=`puppet agent --configprint agent_catalog_run_lockfile`
+
+# From here out, make a best effort to continue in the face of failure
+set +e
+
 if [ -n "$PUPPETLOCK" -a -e "$PUPPETLOCK" ]; then
-    set +e
     PUPPETPID=$(cat $PUPPETLOCK)
     CMDLINE_FILE="/proc/$PUPPETPID/cmdline"
     if [ -f $CMDLINE_FILE ]; then
@@ -21,7 +25,6 @@
             exit 0
         fi
     fi
-    set -e
     echo Ignoring stale puppet agent lock for pid `cat $PUPPETLOCK` 
>>/var/log/puppet.log
 fi
 

-- 
To view, visit https://gerrit.wikimedia.org/r/256148
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e3673ccfebdaad0a82848e3bb78b803cdd8e4d7
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to