* 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 <digimer@alteeve.ca>
main
Digimer 2 years ago
parent 3ca8aa45b2
commit a4ef93404c
  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

@ -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,

Loading…
Cancel
Save