Faidon Liambotis has submitted this change and it was merged.

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(-)

Approvals:
  Alexandros Kosiaris: Looks good to me, but someone else must approve
  Faidon Liambotis: Verified; Looks good to me, approved
  Dzahn: Looks good to me, but someone else must approve



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: merged
Gerrit-Change-Id: I7e3673ccfebdaad0a82848e3bb78b803cdd8e4d7
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to