[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 04/11] sg-run-job: Break out testid_matches_globs



No functional change.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-run-job | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/sg-run-job b/sg-run-job
index cc24b73..8f7c36f 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -133,6 +133,15 @@ proc setstatus {st} {
     jobdb::job-set-status $flight $jobinfo(job) $st
 }
 
+proc testid_matches_globs {testid globs} {
+    foreach glob [split $globs] {
+        if {[string match $glob $testid]} {
+            return 1
+        }
+    }
+    return 0
+}
+
 #---------- test script handling ----------
 
 proc run-ts {args} {
@@ -266,12 +275,9 @@ proc reap-ts {reap} {
 
     eval jobdb::step-set-status [lrange $details 0 2] $result
     jobdb::logputs stdout "finished $detstr $result $emsg"
-    foreach truncate_glob [split $truncate_globs] {
-        if {[string match $truncate_glob $testid]} {
-            jobdb::logputs stdout "truncating job now as instructed"
-            set truncate 1
-            break
-        }
+    if {[testid_matches_globs $testid $truncate_globs]} {
+        jobdb::logputs stdout "truncating job now as instructed"
+        set truncate 1
     }
     return [expr {![string compare $result pass]}]
 }
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.