From a4ef93404c0d5e85cbba03040e96840c963e927a Mon Sep 17 00:00:00 2001 From: Digimer Date: Wed, 5 Oct 2022 20:15:32 -0400 Subject: [PATCH] * Fixed a bug in DRBD->gather_data() to remove trailing commas for existing TCP ports. * Added the missing 'clear-mapping' switch to Get->switches in anvil-daemon. Signed-off-by: Digimer --- Anvil/Tools/DRBD.pm | 8 ++++++++ scancore-agents/scan-hardware/scan-hardware | 2 +- tools/anvil-daemon | 2 +- tools/anvil-manage-dr | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Anvil/Tools/DRBD.pm b/Anvil/Tools/DRBD.pm index ebcddd8e..f2776ae9 100644 --- a/Anvil/Tools/DRBD.pm +++ b/Anvil/Tools/DRBD.pm @@ -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; diff --git a/scancore-agents/scan-hardware/scan-hardware b/scancore-agents/scan-hardware/scan-hardware index 0f7ed568..5fb03c0c 100755 --- a/scancore-agents/scan-hardware/scan-hardware +++ b/scancore-agents/scan-hardware/scan-hardware @@ -627,7 +627,7 @@ sub find_changes 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_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_free = $anvil->data->{summary}{ram}{proc}{memory_free}; my $new_scan_hardware_swap_total = $anvil->data->{summary}{ram}{proc}{swap_total}; diff --git a/tools/anvil-daemon b/tools/anvil-daemon index 8312cbb8..cb9f66e2 100755 --- a/tools/anvil-daemon +++ b/tools/anvil-daemon @@ -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 }}); diff --git a/tools/anvil-manage-dr b/tools/anvil-manage-dr index 705a3cd8..29ba4e6c 100755 --- a/tools/anvil-manage-dr +++ b/tools/anvil-manage-dr @@ -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,