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

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Nov 19 08:52:12 CET 2019


On November 18, 2019 4:05 pm, Stefan Reiter wrote:
> PVE::Cluster::Setup::join already calls assert_joinable, we only need the
> explicit call in pvecm if we fall back to SSH.

none of $nodename $link0 $link1 $local_ip_address are used in the 
API-block, and all of them are initialized exactly the same in 
PVE::Cluster::Setup::join(), so please move those declarations in pvecm 
to the SSH-fallback-block as well.

> 
> Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
> ---
>  data/PVE/CLI/pvecm.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/data/PVE/CLI/pvecm.pm b/data/PVE/CLI/pvecm.pm
> index c13d0e7..86c5ce5 100755
> --- a/data/PVE/CLI/pvecm.pm
> +++ b/data/PVE/CLI/pvecm.pm
> @@ -360,8 +360,6 @@ __PACKAGE__->register_method ({
>  	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 {
>  
>  	    if (!$param->{use_ssh}) {
> @@ -385,6 +383,8 @@ __PACKAGE__->register_method ({
>  
>  	    # allow fallback to old ssh only join if wished or needed
>  
> +	    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
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 




More information about the pve-devel mailing list