The error raised when the IP address for a host is not a configured network interface wasn't very clear. Include the IP address that we resolved when displaying the error.

rob
>From 6ee98f0c0fc1f9bf8300a59d5202025dd9e394c7 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@redhat.com>
Date: Wed, 16 May 2012 16:38:01 -0400
Subject: [PATCH] Include more information when IP address is not local during
 installation.

Provide the IP address we resolved when displaying the exception.

Also handle the exception ourselves with sys.exit().

https://fedorahosted.org/freeipa/ticket/2654
---
 ipaserver/install/installutils.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py
index 5c131c3cc7575238491975d36a6428e06188f668..1e04b7b98c1326c17e29b38a7da0e60e3c73fad9 100644
--- a/ipaserver/install/installutils.py
+++ b/ipaserver/install/installutils.py
@@ -522,7 +522,10 @@ def get_server_ip_address(host_name, fstore, unattended, options):
             else:
                 ip = read_ip_address(host_name, fstore)
     elif len(hostaddr) == 1:
-        ip = ipautil.CheckedIPAddress(hostaddr[0], match_local=True)
+        try:
+            ip = ipautil.CheckedIPAddress(hostaddr[0], match_local=True)
+        except ValueError, e:
+            sys.exit("Invalid IP Address %s for %s: %s" % (hostaddr[0], host_name, unicode(e)))
     else:
         # hostname is not resolvable
         ip = options.ip_address
-- 
1.7.10.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to