[pve-devel] [PATCH cluster v2 1/2] get_local_migration_ip: change to a reasonable error message

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Nov 11 09:03:12 CET 2016


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

changes since v1:
* new in v2, instead of an eval/catch block needed by our caller die here
  with a better error message

 data/PVE/Cluster.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm
index df0a8f7..60ea179 100644
--- a/data/PVE/Cluster.pm
+++ b/data/PVE/Cluster.pm
@@ -1063,11 +1063,11 @@ sub get_local_migration_ip {
     if (defined($cidr)) {
 	my $ips = PVE::Network::get_local_ip_from_cidr($cidr);
 
-	die "no IP address configured on local node for network '$cidr'\n" 
-	    if !$noerr && (scalar(@$ips) == 0);
+	die "could not get migration ip: no IP address configured on local " .
+	    "node for network '$cidr'\n" if !$noerr && (scalar(@$ips) == 0);
 
-	die "multiple IP address configured for network '$cidr'\n" 
-	    if !$noerr && (scalar(@$ips) > 1);
+	die "could not get migration ip: multiple IP address configured for " .
+	    "network '$cidr'\n" if !$noerr && (scalar(@$ips) > 1);
 
 	return @$ips[0];
     }
-- 
2.1.4





More information about the pve-devel mailing list