Merge pull request #247 from ClusterLabs/anvil-tools-dev

* Fixed a bug in DRBD->gather_data() to remove trailing commas for ex…
main
Digimer 2 years ago committed by GitHub
commit ba3e4424d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      Anvil/Tools/DRBD.pm
  2. 2
      tools/anvil-daemon
  3. 3
      tools/anvil-manage-dr
  4. 7
      tools/anvil-manage-files

@ -1253,6 +1253,14 @@ sub gather_data
}
next if not $proxy_found;
# Clear off trailing commas
$host1_tcp_ports =~ s/,$//;
$host2_tcp_ports =~ s/,$//;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
"s1:host1_tcp_ports" => $host1_tcp_ports,
"s2:host2_tcp_ports" => $host2_tcp_ports,
}});
# Save the new info.
$anvil->data->{new}{resource}{$resource}{host1_to_host2}{$host1_name}{$host2_name}{host1_ip_address} = $host1_ip_address;
$anvil->data->{new}{resource}{$resource}{host1_to_host2}{$host1_name}{$host2_name}{host1_tcp_port} = $host1_tcp_ports;

@ -117,7 +117,7 @@ if (not $anvil->data->{sys}{database}{connections})
}
# Read switches
$anvil->Get->switches({list => ["refresh-json", "run-once", "main-loop-only", "no-start", "startup-only"], man => $THIS_FILE});
$anvil->Get->switches({list => ["clear-mapping", "refresh-json", "run-once", "main-loop-only", "no-start", "startup-only"], man => $THIS_FILE});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => $anvil->data->{switches}});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0115", variables => { program => $THIS_FILE }});

@ -2436,6 +2436,7 @@ sub process_protect
protocol => "C",
fencing => "resource-and-stonith"
}});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { connections => $connections }});
# Node 1 to DR
$connections .= $anvil->Words->string({key => $file_key, variables => {
@ -2450,6 +2451,7 @@ sub process_protect
protocol => $dr_protocol,
fencing => "dont-care"
}});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { connections => $connections }});
# Node 2 to DR
$connections .= $anvil->Words->string({key => $file_key, variables => {
@ -2464,6 +2466,7 @@ sub process_protect
protocol => $dr_protocol,
fencing => "dont-care"
}});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { connections => $connections }});
my $new_resource_config = $anvil->Words->string({key => "file_0006", variables => {
server => $server_name,

@ -932,6 +932,10 @@ sub check_for_deletes
my $query = "SELECT file_uuid, file_directory || '/' || file_name AS full_path FROM files WHERE file_type = 'DELETED';";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { query => $query }});
# This will be used to make sure we only delete from files
my $files_directory = $anvil->data->{path}{directories}{shared}{files};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { files_directory => $files_directory }});
my $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__});
my $count = @{$results};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
@ -947,6 +951,9 @@ sub check_for_deletes
's2:full_path' => $full_path,
}});
# Only delete if the file is in the shared directory.
next if $full_path !~ /^$files_directory/;
# Get rid of it (if it actually exists).
if (-e $full_path)
{

Loading…
Cancel
Save