* Fixed a bug where 'timeout' would repeatedly get added to drbd's global-common.conf file.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 4 years ago
parent 992143ef1b
commit d155c2eb66
  1. 54
      Anvil/Tools/DRBD.pm

@ -2769,25 +2769,25 @@ sub update_global_common
}
}
if ($line =~ /(\s*)timeout(\s+)(.*?)(;.*)$/)
if ($line =~ /(\s*)ping-timeout(\s+)(.*?)(;.*)$/)
{
my $left_space = $1;
my $middle_space = $2;
my $value = $3;
my $right_side = $4;
$timeout_seen = 1;
my $left_space = $1;
my $middle_space = $2;
my $value = $3;
my $right_side = $4;
$ping_timeout_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:timeout_seen' => $timeout_seen,
's1:left_space' => $left_space,
's2:middle_space' => $middle_space,
's3:value' => $value,
's4:right_side' => $right_side,
's5:ping_timeout_seen' => $ping_timeout_seen,
}});
if ($value ne $say_timeout)
if ($value ne $say_ping_timeout)
{
$update = 1;
my $new_line = $left_space."timeout".$middle_space.$say_timeout.$right_side;
my $new_line = $left_space."ping-timeout".$middle_space.$say_ping_timeout.$right_side;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,
@ -2798,26 +2798,26 @@ sub update_global_common
next;
}
}
if ($line =~ /(\s*)ping-timeout(\s+)(.*?)(;.*)$/)
# For some reason, this matches 'ping-timeout' hence the 'else'.
elsif ($line =~ /(\s*)timeout(\s+)(.*?)(;.*)$/)
{
my $left_space = $1;
my $middle_space = $2;
my $value = $3;
my $right_side = $4;
$ping_timeout_seen = 1;
my $left_space = $1;
my $middle_space = $2;
my $value = $3;
my $right_side = $4;
$timeout_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:ping_timeout_seen' => $ping_timeout_seen,
's1:left_space' => $left_space,
's2:middle_space' => $middle_space,
's3:value' => $value,
's4:right_side' => $right_side,
's5:timeout_seen' => $timeout_seen,
}});
if ($value ne $say_ping_timeout)
if ($value ne $say_timeout)
{
$update = 1;
my $new_line = $left_space."ping-timeout".$middle_space.$say_ping_timeout.$right_side;
my $new_line = $left_space."timeout".$middle_space.$say_timeout.$right_side;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
's1:update' => $update,
's2:new_line' => $new_line,

Loading…
Cancel
Save