From 9028611afbe19023d2eaa7e1247301c9c4c6e1e4 Mon Sep 17 00:00:00 2001 From: Digimer Date: Thu, 30 Jun 2022 14:09:12 -0400 Subject: [PATCH] * Fixed a bug in Get->bridges were the bridge was not marked as found when parsing json output, breaking ocf:alteeve:server Signed-off-by: Digimer --- Anvil/Tools/Get.pm | 18 +++++++++++++----- Anvil/Tools/Network.pm | 7 +++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Anvil/Tools/Get.pm b/Anvil/Tools/Get.pm index 187eef77..c2d99aaf 100644 --- a/Anvil/Tools/Get.pm +++ b/Anvil/Tools/Get.pm @@ -769,7 +769,9 @@ sub bridges my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3; $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Get->bridges()" }}); - my ($output, $return_code) = $anvil->System->call({shell_call => $anvil->data->{path}{exe}{bridge}." -json -details link show"}); + my $shell_call = $anvil->data->{path}{exe}{bridge}." -json -details link show"; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { shell_call => $shell_call }}); + my ($output, $return_code) = $anvil->System->call({shell_call => $shell_call}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { output => $output, return_code => $return_code, @@ -899,13 +901,19 @@ sub bridges my $type = "interface"; my $interface = $hash_ref->{ifname}; my $master_bridge = $hash_ref->{master}; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { + interface => $interface, + master_bridge => $master_bridge, + }}); + + $anvil->data->{$host}{network}{bridges}{bridge}{$master_bridge}{found} = 1; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { + "${host}::network::bridges::bridge::${master_bridge}::found" => $anvil->data->{$host}{network}{bridges}{bridge}{$master_bridge}{found}, + }}); if ($interface eq $master_bridge) { $type = "bridge"; - $anvil->data->{$host}{network}{bridges}{bridge}{$interface}{found} = 1; - $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { - "${host}::network::bridges::bridge::${interface}::found" => $anvil->data->{$host}{network}{bridges}{bridge}{$interface}{found}, - }}); + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { type => $type }}); } else { diff --git a/Anvil/Tools/Network.pm b/Anvil/Tools/Network.pm index 29390efe..f6a05271 100644 --- a/Anvil/Tools/Network.pm +++ b/Anvil/Tools/Network.pm @@ -244,7 +244,6 @@ sub check_firewall my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3; $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Network->check_firewall()" }}); - my $running = 0; # Make sure firewalld is running. @@ -260,7 +259,7 @@ sub check_firewall #if ($anvil->data->{sys}{daemons}{restart_firewalld}) if (0) { - $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 0, priority => "err", key => "log_0127"}); + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, priority => "alert", key => "log_0127"}); my $return_code = $anvil->System->start_daemon({daemon => $anvil->data->{sys}{daemon}{firewalld}}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { return_code => $return_code }}); if ($return_code) @@ -278,7 +277,7 @@ sub check_firewall else { # We've been asked to leave it off. - $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, priority => "err", key => "log_0128"}); + $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, priority => "alert", key => "log_0128"}); return(0); } } @@ -2948,7 +2947,7 @@ sub manage_firewall my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3; $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0125", variables => { method => "Network->manage_firewall()" }}); - return(1); + return(0); my $task = defined $parameter->{task} ? $parameter->{task} : "check"; my $port_number = defined $parameter->{port_number} ? $parameter->{port_number} : "";