[pve-devel] [PATCH v2 cluster 2/3] pvecm: move assert_joinable to avoid double call

Stefan Reiter s.reiter at proxmox.com
Tue Nov 19 10:28:28 CET 2019


PVE::Cluster::Setup::join already calls assert_joinable, we only need the
explicit call in pvecm if we fall back to SSH.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 data/PVE/CLI/pvecm.pm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/data/PVE/CLI/pvecm.pm b/data/PVE/CLI/pvecm.pm
index c13d0e7..cf5e448 100755
--- a/data/PVE/CLI/pvecm.pm
+++ b/data/PVE/CLI/pvecm.pm
@@ -353,14 +353,7 @@ __PACKAGE__->register_method ({
 	my ($param) = @_;
 
 	my $nodename = PVE::INotify::nodename();
-
 	my $host = $param->{hostname};
-	my $local_ip_address = PVE::Cluster::remote_node_ip($nodename);
-
-	my $link0 = PVE::Corosync::parse_corosync_link($param->{link0});
-	my $link1 = PVE::Corosync::parse_corosync_link($param->{link1});
-
-	PVE::Cluster::Setup::assert_joinable($local_ip_address, $link0, $link1, $param->{force});
 
 	my $worker = sub {
 
@@ -385,6 +378,13 @@ __PACKAGE__->register_method ({
 
 	    # allow fallback to old ssh only join if wished or needed
 
+	    my $local_ip_address = PVE::Cluster::remote_node_ip($nodename);
+
+	    my $link0 = PVE::Corosync::parse_corosync_link($param->{link0});
+	    my $link1 = PVE::Corosync::parse_corosync_link($param->{link1});
+
+	    PVE::Cluster::Setup::assert_joinable($local_ip_address, $link0, $link1, $param->{force});
+
 	    PVE::Cluster::Setup::setup_sshd_config();
 	    PVE::Cluster::Setup::setup_rootsshconfig();
 	    PVE::Cluster::Setup::setup_ssh_keys();
-- 
2.20.1





More information about the pve-devel mailing list