]> xenbits.xensource.com Git - osstest.git/commitdiff
sg-run-job: New @ iffail tag for prep tasks
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 22 May 2019 15:34:42 +0000 (16:34 +0100)
committerIan Jackson <iwj@xenproject.org>
Wed, 7 Oct 2020 16:07:42 +0000 (17:07 +0100)
Currently no users sites, so no functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
sg-run-job

index 3f44cae7369dfe5590617415c4063b4333a9262d..a074cd423fbde5b6b1683d971f69c30a1e664715 100755 (executable)
@@ -223,12 +223,15 @@ proc recipe-flag {flagname {def 0}} {
 #
 #  IFFAIL can be
 #
-#           [-][!].
-#           [-][!]STATUS
+#           [@][-][!].
+#           [@][-][!]STATUS
 #
 #       where STATUS is the job/step status to be used if the step
 #       status is not as expected, and the special meanings are:
 #
+#           @      Only for per-host-ts: prefix each ident with @
+#                  to run this script only if the host is `prep'
+#                  and not if it is `ready'.
 #           -      for run-ts; suprresses exception on failure.
 #                  for per-host-ts; suppresses consequences of failure.
 #           !      Run this even if the job is being truncated.
@@ -452,8 +455,11 @@ proc reap-ts {reap {wantstatus pass}} {
 
 proc per-host-ts {iffail ident script args} {
     global ok truncate need_xen_hosts flight jobinfo
+
+    set isprep [lindex {{} @} [regsub {^\@} $iffail {} iffail]]
  
-    if {![iffail-check $iffail {$ok && !$truncate} iffail_status]} return
+    if {![iffail-check $iffail {$ok && !$truncate} iffail_status]} \
+       return
 
     set awaitl {}
     foreach host $need_xen_hosts {
@@ -461,7 +467,7 @@ proc per-host-ts {iffail ident script args} {
        if {[string compare $host host]} {
            lappend hostargs +! $host
        }
-       lappend hostargs + $host
+       lappend hostargs + $isprep$host
         lappend awaitl [eval spawn-ts $iffail $ident $script $hostargs $args]
     }