* Fixed a bug where fence-handler was repeatedly added by scan-drbd.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 2 years ago
parent 02e371ac56
commit 4528f07508
  1. 54
      Anvil/Tools/DRBD.pm
  2. 1
      scancore-agents/scan-drbd/scan-drbd

@ -3104,25 +3104,26 @@ sub update_global_common
}
if ($in_handlers)
{
if ($line =~ /(\s*)fence-peer(\s+)(.*?)(;.*)$/)
if ($line =~ /(\s*)unfence-peer(\s+)(.*?)(;.*)$/)
{
my $left_space = $1;
my $middle_space = $2;
my $value = $3;
my $right_side = $4;
$fence_peer_seen = 1;
my $left_space = $1;
my $middle_space = $2;
my $value = $3;
my $right_side = $4;
$unfence_peer_seen = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:left_space' => $left_space,
's2:middle_space' => $middle_space,
's3:value' => $value,
's4:right_side' => $right_side,
's5:fence_peer_seen' => $fence_peer_seen,
's1:left_space' => $left_space,
's2:middle_space' => $middle_space,
's3:value' => $value,
's4:right_side' => $right_side,
's5:unfence_peer_seen' => $unfence_peer_seen,
's6:say_unfence_peer' => $say_unfence_peer,
}});
if ($value ne $say_fence_peer)
if ($value ne $say_unfence_peer)
{
$update = 1;
my $new_line = $left_space."fence-peer".$middle_space.$say_fence_peer.$right_side;
my $new_line = $left_space."unfence-peer".$middle_space.$say_unfence_peer.$right_side;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
@ -3133,25 +3134,26 @@ sub update_global_common
next;
}
}
if ($line =~ /(\s*)unfence-peer(\s+)(.*?)(;.*)$/)
elsif ($line =~ /(\s*)fence-peer(\s+)(.*?)(;.*)$/)
{
my $left_space = $1;
my $middle_space = $2;
my $value = $3;
my $right_side = $4;
$unfence_peer_seen = 1;
my $left_space = $1;
my $middle_space = $2;
my $value = $3;
my $right_side = $4;
$fence_peer_seen = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:left_space' => $left_space,
's2:middle_space' => $middle_space,
's3:value' => $value,
's4:right_side' => $right_side,
's5:unfence_peer_seen' => $fence_peer_seen,
's1:left_space' => $left_space,
's2:middle_space' => $middle_space,
's3:value' => $value,
's4:right_side' => $right_side,
's5:fence_peer_seen' => $fence_peer_seen,
's6:say_fence_peer' => $say_fence_peer,
}});
if ($value ne $say_unfence_peer)
if ($value ne $say_fence_peer)
{
$update = 1;
my $new_line = $left_space."unfence-peer".$middle_space.$say_unfence_peer.$right_side;
my $new_line = $left_space."fence-peer".$middle_space.$say_fence_peer.$right_side;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,

@ -154,6 +154,7 @@ sub check_config
}
my $updated = $anvil->DRBD->update_global_common({
debug => 2,
usage_count => $anvil->data->{sys}{privacy}{strong} ? 0 : 1,
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { updated => $updated }});

Loading…
Cancel
Save