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

[Xen-devel] [OSSTEST PATCH 08/13] sg-report-host-history: Write cache entries


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 8 Nov 2019 18:49:56 +0000
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@xxxxxxxxxxxxx; spf=Pass smtp.mailfrom=Ian.Jackson@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 08 Nov 2019 18:50:58 +0000
  • Ironport-sdr: V6SjVUiFAjnPPeuqeZoOhSWB15rHrzTKWgEy9zJv0aWlkzL4lkreCnGPpI0RfsLF5hDFmIv5BH N9X6WE8hYigpWHP0fI9NnESA2ciL6YIBpveP7ZpeOp8DUepwRlAmQ1rwLA4Wgl86WguS7DORik Qub4SP3RZS7yTOiKYSHShno3ENJ+ir2U9K7djibtcyJKAf2bCZMIFlfonb9piPqtQ1W3qoR7U4 NahEhY6cw30cxFAZDZBzFVV1MnWB0CWcHlO8m4ZIbcaPRTh6iiRa7j51UI1EbKezhk0to3Gbpa rG4=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Write the %$jr contents out in a fairly terse format.  We stuff it
into a parseable SGML/XML comment in the output HTML.

Nothing makes use of this yet - parsing it back in will come later.

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

diff --git a/sg-report-host-history b/sg-report-host-history
index 8767b25d..335efa1c 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -246,6 +246,27 @@ END
        push @rows, { %$jr, %$endedrow };
     }
 
+    my $write_cache_entry = sub {
+       my ($jr) = @_;
+        print H "<!-- osstest-report-reuseable";
+       my $whash = sub {
+           my ($h) = @_;
+           foreach my $k (sort keys %$h) {
+               next if $k =~ m/^\%/;
+               $_ = $h->{$k};
+               s{[^-+=/~:;_.,\w]}{ sprintf "%%%02x", ord $& }ge;
+               printf H " %s=%s", $k, $_;
+           }
+       };
+       $whash->($jr);
+       foreach my $hk (sort keys %$jr) {
+           next unless $hk =~ m/^\%/;
+           print H " $'";
+           $whash->($jr->{$hk});
+       }
+       print H " -->\n";
+    };
+
     @rows = sort { $b->{finished} <=> $a->{finished} } @rows;
     $#rows = $limit-1 if @rows > $limit;
 
@@ -338,6 +359,8 @@ END
         print H "<td>" if !$any_power;
        print H "</td>\n";
 
+       $write_cache_entry->($jr);
+
        print H "</tr>\n\n";
        $alternate ^= 1;
     }
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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