[pve-devel] [PATCH cluster 1/2] pvecm: check if APIClient exception code is defined

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Mar 6 10:06:41 CET 2018


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 data/PVE/CLI/pvecm.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/PVE/CLI/pvecm.pm b/data/PVE/CLI/pvecm.pm
index 124f9cd..746bcbe 100755
--- a/data/PVE/CLI/pvecm.pm
+++ b/data/PVE/CLI/pvecm.pm
@@ -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";
 		    }
-- 
2.14.2





More information about the pve-devel mailing list