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

[Xen-devel] [OSSTEST PATCH 11/13] sg-report-host-history: Move job runvars query later


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 8 Nov 2019 18:49:59 +0000
  • Authentication-results: esa3.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:20 +0000
  • Ironport-sdr: PkXCYu8RiLjR27sGsX7g0yHXMUw70c1jn+NeXMOzFdjysZgCgInnI29MpCw5uxZlJnYWOXT/GP GogTrxucrPNgoMmy7TW8T3eCxY0J2McOtERS/AxWIhsa4MKWQ0p4lklaBctotrtgAnPVcrcRbX PTTFJe2r930QbARa1p2eOMyRmnlWhL0l6PgbBNdqYxwZl9aVtupemKBrsoZsqUoLCkODwhKNY+ SoIujzU8KpBGzeFtC30nTMu6fBvZmnbZebV/h9ErgsVZVXWWprjXIZ76j1YtDQ4nASRoHT1mge dvw=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This query is just used for the power methods.  Put it near there.
Also, indent it in a `do' block.  These changes will make the next
change easier to read.

No functional change.

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

diff --git a/sg-report-host-history b/sg-report-host-history
index e67c7346..7c2116d3 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -332,11 +332,6 @@ END
        my $ir = jobquery($infoq, $jr, 'i');
        my $ar = jobquery($allocdq, $jr, 'a');
        my $ident = $jr->{name};
-       $jrunvarq->execute($jr->{flight}, $jr->{job}, $ident);
-        my %runvars;
-        while (my ($n, $v) = $jrunvarq->fetchrow_array()) {
-            $runvars{$n} = $v;
-        }
 
        my $altcolour = report_altcolour($alternate);
        print H "<tr $altcolour>";
@@ -377,10 +372,18 @@ END
        print H "<td $ri->{ColourAttr}>$ri->{Content}</td>\n";
 
        my %powers;
-       foreach my $r (sort keys %runvars) {
-           next unless $r =~ m{^\Q${ident}\E_power_};
-           $powers{$'} = $runvars{$r};
-       }
+       do {
+           $jrunvarq->execute($jr->{flight}, $jr->{job}, $ident);
+           my %runvars;
+           while (my ($n, $v) = $jrunvarq->fetchrow_array()) {
+               $runvars{$n} = $v;
+           }
+
+           foreach my $r (sort keys %runvars) {
+               next unless $r =~ m{^\Q${ident}\E_power_};
+               $powers{$'} = $runvars{$r};
+           }
+       };
        my $skipped = 0;
         my $any_power = 0;
         my $pr_power_colour = sub {
-- 
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®.