[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
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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |