From e30a586d269c3f1b90d04b5c73d0a3407bf22291 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 24 Jun 2016 12:56:03 -0300 Subject: Deploy: error handling --- lib/hydra/deploy | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib') diff --git a/lib/hydra/deploy b/lib/hydra/deploy index 333f183..84e31a2 100644 --- a/lib/hydra/deploy +++ b/lib/hydra/deploy @@ -204,6 +204,12 @@ function hydra_deploy_copy { $SUDO cp $orig $dest elif [ "$location" == "remote" ]; then $DEPLOY_RSYNC "$RSYNC_PATH" $orig $dest + + # Check result + if [ "$?" != "0" ]; then + echo "Error copying data to $FQDN." + exit 1 + fi fi } @@ -215,5 +221,11 @@ function hydra_deploy_facts_collect { $SUDO facter --yaml > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml elif [ "$1" == "remote" ]; then $HYDRA_CONNECT $FQDN sudo facter --yaml > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml + + # Check result + if [ "$?" != "0" ]; then + echo "Error retrieving facts from $FQDN." + exit 1 + fi fi } -- cgit v1.2.3