Fixed a minor striker-boot-machine bug.

Divide by zero error when no hosts with IPMI found.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 1 year ago
parent b4158792db
commit a35e790a4d
  1. 1
      share/words.xml
  2. 13
      tools/striker-boot-machine

@ -3179,6 +3179,7 @@ Proceed? [y/N]</key>
<key name="message_0354">This host is now configured to map the network.</key> <key name="message_0354">This host is now configured to map the network.</key>
<key name="message_0355">This host is already NOT configured to map the network.</key> <key name="message_0355">This host is already NOT configured to map the network.</key>
<key name="message_0356">This host is no longer configured to map the network.</key> <key name="message_0356">This host is no longer configured to map the network.</key>
<key name="message_0357">No hosts with IPMI found, done.</key>
<!-- Translate names (protocols, etc) --> <!-- Translate names (protocols, etc) -->
<key name="name_0001">Normal Password</key> <!-- none in mail-server --> <key name="name_0001">Normal Password</key> <!-- none in mail-server -->

@ -151,11 +151,16 @@ sub find_boot_method
} }
my $host_count = @{$hosts}; my $host_count = @{$hosts};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { host_count => $host_count }});
if (not $host_count)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, key => "message_0357"});
$anvil->Job->update_progress({progress => 100, message => "message_0357"});
$anvil->nice_exit({exit_code => 0});
}
my $steps = int((80 / $host_count) / 3); my $steps = int((80 / $host_count) / 3);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { steps => $steps }});
host_count => $host_count,
steps => $steps,
}});
$anvil->data->{sys}{progress} = 5; $anvil->data->{sys}{progress} = 5;
foreach my $host_name (sort {$a cmp $b} @{$hosts}) foreach my $host_name (sort {$a cmp $b} @{$hosts})

Loading…
Cancel
Save