From 9fd497464e98d3b89911d464dca688f23a157d9f Mon Sep 17 00:00:00 2001 From: Richard Su Date: Fri, 4 Nov 2011 13:50:41 -0700 Subject: [PATCH] BZ 747768 - aeolus-configure should exit w/ non 0 exit code if there is a failure Turned on puppet's detailed exit codes option. Puppet exits 0 if success or 2 if success and changes were made. Added code to exit 1 if puppet exits with status other than 0 or 2. --- bin/aeolus-cleanup | 6 +++++- bin/aeolus-configure | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/aeolus-cleanup b/bin/aeolus-cleanup index cadda76..230b9a9 100644 --- a/bin/aeolus-cleanup +++ b/bin/aeolus-cleanup @@ -55,4 +55,8 @@ puppet /usr/share/aeolus-configure/modules/aeolus/aeolus.pp \ --external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node $PUPPET_NODE" --node_terminus exec \ --logdest=/var/log/aeolus-configure/aeolus-cleanup.log \ --logdest=console \ - $LOGLEVEL + $LOGLEVEL \ + --detailed-exitcodes +if [ $? != 0 -a $? != 2 ] ; then + exit 1 +fi diff --git a/bin/aeolus-configure b/bin/aeolus-configure index 16a1bc0..415f466 100755 --- a/bin/aeolus-configure +++ b/bin/aeolus-configure @@ -76,5 +76,9 @@ do --external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node $x" --node_terminus exec \ --logdest=/var/log/aeolus-configure/aeolus-configure.log \ --logdest=console \ - $LOGLEVEL + $LOGLEVEL \ + --detailed-exitcodes + if [ $? != 0 -a $? != 2 ] ; then + exit 1 + fi done