Fixed a bug where, if the host IPMI BMC wouldn't allow spaces in the password and the user had a space, IPMI would never configure or get used as a fence method.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 3 years ago
parent e8dcb8b24c
commit 2c76103a96
  1. 17
      Anvil/Tools/System.pm
  2. 2
      scancore-agents/scan-cluster/scan-cluster

@ -1770,6 +1770,16 @@ LIMIT 1
password_length => $password_length, password_length => $password_length,
}}); }});
# If the password has spaces, some IPMI BMCs won't allow them. If we need to use it, we'll take out
# the spaces and shrink the length.
my $ipmi_no_space_password = "";
if ($ipmi_password =~ /\s/)
{
$ipmi_no_space_password = $ipmi_password;
$ipmi_no_space_password =~ s/\s//g;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => 1, list => { ipmi_no_space_password => $ipmi_no_space_password }});
}
my $subnet_mask = ""; my $subnet_mask = "";
my $gateway = ""; my $gateway = "";
my $in_network = ""; my $in_network = "";
@ -2229,6 +2239,13 @@ LIMIT 1
} }
else else
{ {
# If we used the no-space password, set it as the ipmi_password now.
if ($ipmi_no_space_password)
{
$ipmi_password = $ipmi_no_space_password;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => 1, list => { ipmi_password => $ipmi_password }});
}
# Change the password and then try again. # Change the password and then try again.
my $escaped_ipmi_password = shell_quote($ipmi_password); my $escaped_ipmi_password = shell_quote($ipmi_password);
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => 1, list => { escaped_ipmi_password => $escaped_ipmi_password }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => 1, list => { escaped_ipmi_password => $escaped_ipmi_password }});

@ -214,7 +214,7 @@ sub check_fence_delay
}}); }});
if ((not $local_server_count) && (not $peer_server_count)) if ((not $local_server_count) && (not $peer_server_count))
{ {
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0636"}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0636"});
return(0); return(0);
} }
elsif (($local_server_count) && ($peer_server_count)) elsif (($local_server_count) && ($peer_server_count))

Loading…
Cancel
Save