* Fixed a bug in DRBD->manage_resource() that prevented new resources from being created.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 1 year ago
parent acca7517cd
commit 79ff96cee5
  1. 17
      Anvil/Tools/DRBD.pm

@ -2601,14 +2601,14 @@ sub manage_resource
{
$anvil->DRBD->get_status({debug => $debug});
}
my $peer_name = $anvil->data->{drbd}{config}{$host}{peer};
my $connection_state = $anvil->data->{drbd}{status}{$host}{resource}{$resource}{connection}{$peer_name}{'connection-state'};
my $peer_name = $anvil->data->{drbd}{config}{$host}{peer} // "";
my $connection_state = $anvil->data->{drbd}{status}{$host}{resource}{$resource}{connection}{$peer_name}{'connection-state'} // "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
peer_name => $peer_name,
resource => $resource,
connection_state => $connection_state,
}});
if (lc($connection_state) eq "standalone")
if (($connection_state) && (lc($connection_state) eq "standalone"))
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, priority => "alert", key => "log_0746", variables => { resource => $resource }});
@ -2653,20 +2653,15 @@ sub manage_resource
}
# This generally brings up the resource
if ($peer_name)
{
# This isn't fatal when bringing up the resource
my ($return_code) = $anvil->DRBD->allow_two_primaries({
debug => 2,
resource => $resource,
set_to => "no",
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { return_code => $return_code }});
if ($return_code)
{
# Abort the migration.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 1, priority => "alert", key => "error_0422", variables => {
server_name => $resource,
return_code => $return_code,
}});
return($return_code);
}
# Now call an adjust to make sure all other config details are loaded. It also up's the

Loading…
Cancel
Save