Commit 9534e44d authored by Gary Wong's avatar Gary Wong

When forecasting node usage, explicitly show everything free at time 0.

This seems better in the case when there are no experiments and no
reservations using the node type in question (formerly we would just
return an empty list... not very useful), and arguably better in less
trivial cases, too.
parent 250480de
......@@ -665,6 +665,14 @@ sub IsFeasible($$;$$$$$)
push( @timeline, $end ) if( defined( $end->{'t'} ) );
}
if( defined( $forecast ) ) {
my %origin = (
t => 0,
free => $free
);
push( @$forecast, \%origin );
}
my @events = sort { $a->{'t'} <=> $b->{'t'} } @timeline;
foreach my $event ( @events ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment