@@ -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 {
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@eu.citrix.com> --- sg-report-host-history | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)