From 037f509aa74c9ddd6c0a8683bdf14d4649b48346 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 25 Sep 2015 16:47:50 -0700 Subject: [PATCH] Rename timeout_hook to with_timeout Because we might actually want a "timeout_hook" some day. Change-Id: I41f07f05e2f1795069ac1be69a3f53de7b70a88e --- devstack-vm-gate-wrap.sh | 6 +++--- functions.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index bc9a6b94..2e58299f 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -519,11 +519,11 @@ fi # Note that hooks should be multihost aware if necessary. # devstack-vm-gate-wrap.sh will not automagically run the hooks on each node. # Run pre test hook if we have one -timeout_hook call_hook_if_defined "pre_test_hook" +with_timeout call_hook_if_defined "pre_test_hook" # Run the gate function echo "Running gate_hook" -timeout_hook "gate_hook" +with_timeout "gate_hook" GATE_RETVAL=$? RETVAL=$GATE_RETVAL @@ -537,7 +537,7 @@ fi # Run post test hook if we have one if [ $GATE_RETVAL -eq 0 ]; then # Run post_test_hook if we have one - timeout_hook call_hook_if_defined "post_test_hook" + with_timeout call_hook_if_defined "post_test_hook" RETVAL=$? fi diff --git a/functions.sh b/functions.sh index e74b48ca..a39dcbf3 100644 --- a/functions.sh +++ b/functions.sh @@ -991,7 +991,7 @@ function ovs_gre_bridge { # Timeout hook calls implemented as bash functions. Note this # forks and execs a new bash in order to use the timeout utility # which cannot operate on bash functions directly. -function timeout_hook { +function with_timeout { local cmd=$@ remaining_time timeout -s 9 ${REMAINING_TIME}m bash -c "source $WORKSPACE/devstack-gate/functions.sh && $cmd"