sg-run-job: Make nested-layer-descend insist on $ok
PATCH 1/1 sg-run-job: Make nested-layer-descend insist on $ok
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.
--- sg-run-job | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sg-run-job +2 -1
@@ -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 ----------
Signature · 1 line
1.7.10.4
Quoted 10 lines · Ian Jackson
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 <[email protected]>Signed-off-by Ian Jackson <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel