#!/bin/bash -xe

# Clean rpm locks before puppet run.
# See ticket https://bugs.launchpad.net/fuel/+bug/1339236
rm -f /var/lib/rpm/__db.*
rpm --rebuilddb

exitcode=0
puppet apply --detailed-exitcodes -v /etc/puppet/modules/nailgun/examples/keystone-only.pp || exitcode=$?
if [ $exitcode -ge 4 ]; then
  echo Puppet apply failed with exit code: $exitcode
  exit $exitcode
fi

service openstack-keystone stop
keystone-all

#!/bin/bash

# Clean rpm locks before puppet run.
# See ticket https://bugs.launchpad.net/fuel/+bug/1339236
rm -f /var/lib/rpm/__db.*
rpm --rebuilddb

puppet apply -v /etc/puppet/modules/nailgun/examples/keystone-only.pp
service openstack-keystone stop
keystone-all

--- 
+++ 
@@ -1,10 +1,16 @@
-#!/bin/bash
+#!/bin/bash -xe
 
 # Clean rpm locks before puppet run.
 # See ticket https://bugs.launchpad.net/fuel/+bug/1339236
 rm -f /var/lib/rpm/__db.*
 rpm --rebuilddb
 
-puppet apply -v /etc/puppet/modules/nailgun/examples/keystone-only.pp
+exitcode=0
+puppet apply --detailed-exitcodes -v /etc/puppet/modules/nailgun/examples/keystone-only.pp || exitcode=$?
+if [ $exitcode -ge 4 ]; then
+  echo Puppet apply failed with exit code: $exitcode
+  exit $exitcode
+fi
+
 service openstack-keystone stop
 keystone-all
Exit keystone container if puppet fails

Change-Id: Iaa2dbf90b2c2e560a7cece61c252abc7f039673b
Closes-Bug: #1353574
