Commit 4f35e40f authored by Mike Hibler's avatar Mike Hibler

Allow power to be used on nodes that are not yet in the DB.

That is, they are not in the nodes table but they are in the outlets table.
Useful during initial bring up.
parent 29b989ba
......@@ -208,8 +208,12 @@ foreach my $node (@machines) {
my ($power_id, $outlet, $last_power, $nodetype) = $result->fetchrow();
my $typeinfo = NodeType->Lookup($nodetype);
my $power_delay = $typeinfo->power_delay();
my $power_delay = 60;
# XXX hack for using power before nodes have been added
if (defined($nodetype)) {
my $typeinfo = NodeType->Lookup($nodetype);
$power_delay = $typeinfo->power_delay();
my $time_ok = (time() - $power_delay > $last_power ? 1 : 0);
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