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

[OSSTEST PATCH 41/60] sg-report-job-history (nfc): Make $ri->{Hosts} a hash


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:46 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:22:55 +0000
  • Ironport-sdr: XLTBOLShMunTVXpzUPk0nL30OigiYSi84mZ8SU1DYgCm8dckGpD+ff64M3PkY9hrJUNTxBlzKs dxjwmp/nV5gCvaCGIXPNgoQkojgEJDz7k3+/Yajo79Hsp/OFfvNQAfa1l2U9BVuk3m8vBtqayB 1yoJu4XWTtS0qKEsnSZi9v8icnD2uUbbFbIsxZbNz+sxCVhzgwbLSbtMZysSIHCiPhQIxvCILn 2Zr9JovgA0ZOfe9XxcAyvCNjX3G0PfZf9Mmv6KiSEwhryICoE9Uz87t2rYH2x9Pl+teg4jtIYc 60Q=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This will make it easier to cache this.

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

diff --git a/sg-report-job-history b/sg-report-job-history
index 8932458e..118926c6 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -173,11 +173,11 @@ END
     while (my $f= $flightsq->fetchrow_hashref()) {
         my $ri= report_run_getinfo($f);
 
-       $ri->{Hosts} = [ ];
+       $ri->{Hosts} = { };
        foreach my $hostvar (@hostvarcols) {
            $hostq->execute($f->{flight}, $f->{job}, $hostvar);
            my ($host) = $hostq->fetchrow_array();
-           push @{ $ri->{Hosts} }, ($host // "-");
+           $ri->{Hosts}{$hostvar} = $host;
        }
 
         my %revisions;
@@ -255,7 +255,7 @@ END
        print H "<td $r->{ColourAttr}><a href=\"$url\">".
            $r->{Content}."</a></td>\n";
        my $lastrev;
-       my $hosts = join ", ", map { $_ // "-" } @{ $r->{Hosts} };
+       my $hosts = join ", ", map { $r->{Hosts}{$_} // "-" } @hostvarcols;
        my $hosts_colour = report_altchangecolour(\$alt_hosts, $hosts);
        print H "<td $hosts_colour>".encode_entities($hosts)."</td>\n";
        $osstestverq->execute($r->{Flight}{flight});
-- 
2.11.0




 


Rackspace

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