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
This commit is contained in:
Sean Dague 2015-02-17 09:47:58 -05:00
parent 68548fdcc3
commit 57be7c262e
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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 {