From decc7ec931f89413d68dc05e561df3b0b44b8e60 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Fri, 26 Apr 2013 14:37:19 +0200
Subject: [PATCH] Fix unclear error when replacing a nic's ip

The current error message ends up saying something like
'192.168.5.5' != 'network1', which is sort of non-intuitive (yes, of
course they are different). Fix this by explaining better what the
erroneous condition actually is.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
---
 lib/cmdlib.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 6a091f2e2..bcf6724c9 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -16940,7 +16940,8 @@ def _CheckForConflictingIp(lu, ip, node):
   """
   (conf_net, _) = lu.cfg.CheckIPInNodeGroup(ip, node)
   if conf_net is not None:
-    raise errors.OpPrereqError(("Conflicting IP address found: '%s' != '%s'" %
+    raise errors.OpPrereqError(("The requested IP address (%s) belongs to"
+                                " network %s, but the target NIC does not." %
                                 (ip, conf_net)),
                                errors.ECODE_STATE)
 
-- 
GitLab