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
      scancore-agents/scan-hardware/scan-hardware
  3. 2
      tools/anvil-daemon
  4. 3
      tools/anvil-manage-dr
  5. 7
      tools/anvil-manage-files

@ -1253,6 +1253,14 @@ sub gather_data
} }
next if not $proxy_found; 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. # 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_ip_address} = $host1_ip_address;
$anvil->data->{new}{resource}{$resource}{host1_to_host2}{$host1_name}{$host2_name}{host1_tcp_port} = $host1_tcp_ports; $anvil->data->{new}{resource}{$resource}{host1_to_host2}{$host1_name}{$host2_name}{host1_tcp_port} = $host1_tcp_ports;

@ -627,7 +627,7 @@ sub find_changes
my $new_scan_hardware_led_id = $anvil->data->{summary}{led}{id_led}; my $new_scan_hardware_led_id = $anvil->data->{summary}{led}{id_led};
my $new_scan_hardware_led_css = $anvil->data->{summary}{led}{css_led}; my $new_scan_hardware_led_css = $anvil->data->{summary}{led}{css_led};
my $new_scan_hardware_led_error = $anvil->data->{summary}{led}{error_led}; my $new_scan_hardware_led_error = $anvil->data->{summary}{led}{error_led};
my $new_scan_hardware_ram_total = $anvil->data->{summary}{ram}{size}; # This is from counting the actual module capacity my $new_scan_hardware_ram_total = $anvil->data->{summary}{ram}{size}; # This is from counting the actual module capacity
my $new_scan_hardware_memory_total = $anvil->data->{summary}{ram}{proc}{memory_total}; # This is from /proc/meminfo and subtracts RAM used by shared video, etc. my $new_scan_hardware_memory_total = $anvil->data->{summary}{ram}{proc}{memory_total}; # This is from /proc/meminfo and subtracts RAM used by shared video, etc.
my $new_scan_hardware_memory_free = $anvil->data->{summary}{ram}{proc}{memory_free}; my $new_scan_hardware_memory_free = $anvil->data->{summary}{ram}{proc}{memory_free};
my $new_scan_hardware_swap_total = $anvil->data->{summary}{ram}{proc}{swap_total}; my $new_scan_hardware_swap_total = $anvil->data->{summary}{ram}{proc}{swap_total};

@ -117,7 +117,7 @@ if (not $anvil->data->{sys}{database}{connections})
} }
# Read switches # 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->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 }}); $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", protocol => "C",
fencing => "resource-and-stonith" fencing => "resource-and-stonith"
}}); }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { connections => $connections }});
# Node 1 to DR # Node 1 to DR
$connections .= $anvil->Words->string({key => $file_key, variables => { $connections .= $anvil->Words->string({key => $file_key, variables => {
@ -2450,6 +2451,7 @@ sub process_protect
protocol => $dr_protocol, protocol => $dr_protocol,
fencing => "dont-care" fencing => "dont-care"
}}); }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { connections => $connections }});
# Node 2 to DR # Node 2 to DR
$connections .= $anvil->Words->string({key => $file_key, variables => { $connections .= $anvil->Words->string({key => $file_key, variables => {
@ -2464,6 +2466,7 @@ sub process_protect
protocol => $dr_protocol, protocol => $dr_protocol,
fencing => "dont-care" 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 => { my $new_resource_config = $anvil->Words->string({key => "file_0006", variables => {
server => $server_name, 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';"; 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 }}); $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 $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__});
my $count = @{$results}; my $count = @{$results};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
@ -947,6 +951,9 @@ sub check_for_deletes
's2:full_path' => $full_path, '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). # Get rid of it (if it actually exists).
if (-e $full_path) if (-e $full_path)
{ {

Loading…
Cancel
Save