From 53d5168dff4b6a174f4dc48b7403171ac163844a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 2 Jul 2019 10:05:57 +0200 Subject: [PATCH] corosync: stylistic changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- data/PVE/Corosync.pm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/data/PVE/Corosync.pm b/data/PVE/Corosync.pm index 3028e26..3b28f6e 100644 --- a/data/PVE/Corosync.pm +++ b/data/PVE/Corosync.pm @@ -273,10 +273,10 @@ sub for_all_corosync_addresses { my $node_address = $node_config->{$node_key}; my($ip, $version) = resolve_hostname_like_corosync($node_address, $corosync_conf); + next if !defined($ip); next if defined($version) && defined($ip_version) && $version != $ip_version; - $func->($node_name, $ip, $version, $node_key) - if defined($ip); + $func->($node_name, $ip, $version, $node_key); } } } @@ -288,11 +288,7 @@ sub resolve_hostname_like_corosync { my ($hostname, $corosync_conf) = @_; my $corosync_strategy = $corosync_conf->{main}->{totem}->{ip_version}; - if (defined($corosync_strategy)) { - $corosync_strategy = lc $corosync_strategy; - } else { - $corosync_strategy = "ipv6-4"; # corosync default - } + $corosync_strategy = lc ($corosync_strategy // "ipv6-4"); my $resolved_ip4; my $resolved_ip6; -- 2.39.2