From: Thomas Lamprecht Date: Mon, 15 Apr 2019 12:39:25 +0000 (+0000) Subject: assert_joinable: report what param caused the error X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a9be558ee9977e005b2282f0229215286b4bcf88;p=pve-cluster.git assert_joinable: report what param caused the error Signed-off-by: Thomas Lamprecht --- diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm index fb4b970..35afba9 100644 --- a/data/PVE/Cluster.pm +++ b/data/PVE/Cluster.pm @@ -1810,11 +1810,12 @@ sub assert_joinable { # check if corosync ring IPs are configured on the current nodes interfaces my $check_ip = sub { my $ip = shift // return; + my $logid = shift; if (!PVE::JSONSchema::pve_verify_ip($ip, 1)) { my $host = $ip; eval { $ip = PVE::Network::get_ip_from_hostname($host); }; if ($@) { - $error->("cannot use '$host': $@\n") ; + $error->("$logid: cannot use '$host': $@\n") ; return; } } @@ -1822,12 +1823,12 @@ sub assert_joinable { my $cidr = (Net::IP::ip_is_ipv6($ip)) ? "$ip/128" : "$ip/32"; my $configured_ips = PVE::Network::get_local_ip_from_cidr($cidr); - $error->("cannot use IP '$ip', it must be configured exactly once on local node!\n") + $error->("$logid: cannot use IP '$ip', it must be configured exactly once on local node!\n") if (scalar(@$configured_ips) != 1); }; - $check_ip->($ring0_addr); - $check_ip->($ring1_addr); + $check_ip->($ring0_addr, 'ring0'); + $check_ip->($ring1_addr, 'ring1'); if ($errors) { warn "detected the following error(s):\n$errors";