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

[Xen-devel] [OSSTEST PATCH 17/17] step logfiles: Rely on new logfile column



These are the three places which read logfile from the db, but had a
fallback to a computation involving stepno and step.

But, after steps-logfile-constraint, the logfile column is NOT NULL
(and populated with computed default data if need be) so this is not
needed any more

This is part of a "Populate-then-rely" schema change, as
described in schema/README.updates.  Specifically, the step:
10. Optionally commit: code which relies on new column, and does not
   necessarily tolerate NULL/DEFAULT; changing `constraint' to Needed.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 determine-failure-reasons           | 2 +-
 schema/steps-logfile-constraint.sql | 2 +-
 sg-report-flight                    | 5 ++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/determine-failure-reasons b/determine-failure-reasons
index 89c67e6..42791c3 100755
--- a/determine-failure-reasons
+++ b/determine-failure-reasons
@@ -52,7 +52,7 @@ sub gethosts ($) {
 }
 
 while (my $step= $stepsq->fetchrow_hashref) {
-    my $logfile = $step->{logfile} // "$step->{stepno}.$step->{step}.log";
+    my $logfile = $step->{logfile};
     $step->{Log}= "$c{Logs}/$step->{flight}/$step->{job}/".$logfile;
 
     if (!stat $step->{Log}) {
diff --git a/schema/steps-logfile-constraint.sql 
b/schema/steps-logfile-constraint.sql
index 462941e..b261fd0 100644
--- a/schema/steps-logfile-constraint.sql
+++ b/schema/steps-logfile-constraint.sql
@@ -1,4 +1,4 @@
--- ##OSSTEST## 004 Ready
+-- ##OSSTEST## 004 Needed
 --
 -- Previously, the logfile name was inferred from "stepno" and
 -- "testid".  Newer code will need it to be set explicitly.
diff --git a/sg-report-flight b/sg-report-flight
index 4e3560e..135f0d4 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -1001,8 +1001,7 @@ END
         printf H "<td>%s</td>", show_abs_time $step->{started};
 
         my $st= $step->{status};
-        my $logfilename= $step->{logfile}
-           // "$step->{stepno}.$step->{step}.log";
+        my $logfilename= $step->{logfile};
         printf H "<td bgcolor='%s'><a href='%s'>%s</a></td>",
            (html_status2_colour_priority($st))[0],
             encode_entities(uri_escape($logfilename)),
@@ -1168,7 +1167,7 @@ END
                : ('#ffff00',250);
        }
        my $ch = "bgcolor=\"$bgc\"";
-       my $logfilename= $s->{logfile} // "$s->{stepno}.$s->{step}.log";
+       my $logfilename= $s->{logfile};
        my $h = "<a href=\"".encode_entities($s->{job}).
            "/".encode_entities($logfilename)."\">";
        #print H "[$s->{stepno}] ";
-- 
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®.