From 57be7c262e521a04cf6a2733eba311075f013a91 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 17 Feb 2015 09:47:58 -0500 Subject: [PATCH] actually save hook logs We've not been saving the hook logs because we are attempting to do the save without enough permissions. example: http://logs.openstack.org/94/156594/1/check/check-swift-dsvm-functional/310e7a6//console.html#_2015-02-17_14_38_21_451 All other logs are moved with sudo, we should do that here as well. For test purposes we make SUDO overridable for this call. In the future we can consider what other SUDO calls are possibly overridable. Change-Id: I6d4a378edd65cbe54243f8089ed9d0bc2b1a6478 --- functions.sh | 4 +++- test-functions.sh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index d5b30ca0..7c18ce8d 100644 --- a/functions.sh +++ b/functions.sh @@ -16,6 +16,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +SUDO="sudo" + # Distro check functions function is_fedora { # note we consider CentOS 7 as fedora for now @@ -51,7 +53,7 @@ function call_hook_if_defined { set -o xtrace -o pipefail tsfilter $hook_name | tee $filename local ret_val=$? - mv $filename $save_dir + $SUDO mv $filename $save_dir set +o pipefail $xtrace return $ret_val diff --git a/test-functions.sh b/test-functions.sh index 95b39a67..92dd60c1 100755 --- a/test-functions.sh +++ b/test-functions.sh @@ -20,6 +20,8 @@ source functions.sh +SUDO="" + # Mock out the checkout function since the refs we're checking out do # not exist. function git_checkout {