* [OSSTEST PATCH] sg-run-job: Make nested-layer-descend insist on $ok
@ 2015-11-23 15:56 Ian Jackson
2015-11-23 15:58 ` Ian Campbell
0 siblings, 1 reply; 2+ messages in thread
From: Ian Jackson @ 2015-11-23 15:56 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Jackson, Ian Campbell
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 <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [OSSTEST PATCH] sg-run-job: Make nested-layer-descend insist on $ok
2015-11-23 15:56 [OSSTEST PATCH] sg-run-job: Make nested-layer-descend insist on $ok Ian Jackson
@ 2015-11-23 15:58 ` Ian Campbell
0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-11-23 15:58 UTC (permalink / raw)
To: Ian Jackson, xen-devel
On Mon, 2015-11-23 at 15:56 +0000, Ian Jackson wrote:
> 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 <ian.campbell@citrix.com>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-23 16:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23 15:56 [OSSTEST PATCH] sg-run-job: Make nested-layer-descend insist on $ok Ian Jackson
2015-11-23 15:58 ` Ian Campbell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.