]> git.proxmox.com Git - pve-cluster.git/commitdiff
pvecm: check if APIClient exception code is defined
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 6 Mar 2018 09:06:41 +0000 (10:06 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 13 Mar 2018 11:26:35 +0000 (12:26 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/CLI/pvecm.pm

index 124f9cd557b5928ac3d15e5f22c972d312fd5fee..746bcbec60f5a1336da5732ba69fab3d0609ad55 100755 (executable)
@@ -123,7 +123,7 @@ __PACKAGE__->register_method ({
                PVE::Tools::lock_file($local_cluster_lock, 10, \&PVE::Cluster::join, $param);
 
                if (my $err = $@) {
-                   if (ref($err) eq 'PVE::APIClient::Exception' && $err->{code} == 501) {
+                   if (ref($err) eq 'PVE::APIClient::Exception' && defined($err->{code}) && $err->{code} == 501) {
                        $err = "Remote side is not able to use API for Cluster join!\n" .
                               "Pass the 'use_ssh' switch or update the remote side.\n";
                    }