From: Ian Jackson Subject: [OSSTEST PATCH] sg-run-job: Make nested-layer-descend insist on $ok Date: Mon, 23 Nov 2015 15:56:36 +0000 Message-ID: <1448294196-22479-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a0tU0-00022Y-04 for xen-devel@lists.xenproject.org; Mon, 23 Nov 2015 15:56:48 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org per-host-ts does nothing if !$ok, so per-host-prep's individual steps become no-ops if the host prep fails, which prevents blundering on. But per-host-prep does not throw. The other call site explicitly avoids calling the recipe script if !$ok. nested-layer-descend is for calling from within a recipe, so we need to throw an exception to abort the script, if !$ok. Reported-by: Ian Campbell Signed-off-by: Ian Jackson --- sg-run-job | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sg-run-job b/sg-run-job index a2527ca..d9b2e38 100755 --- a/sg-run-job +++ b/sg-run-job @@ -260,10 +260,11 @@ proc per-host-ts {iffail ident script args} { proc nested-layer-descend {nested_hosts} { # We save need_xen_hosts on a stack in nested_layers_hosts # It gets popped again during the cleanup part of run-job - global nested_layers_hosts need_xen_hosts + global nested_layers_hosts need_xen_hosts ok lappend nested_layers_hosts $need_xen_hosts set need_xen_hosts $nested_hosts per-host-prep + if {!$ok} { error "host prep ($nested_hosts) (or something else) failed" } } #---------- test recipes ---------- -- 1.7.10.4