summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-01-20 15:15:11 +0100
committerMartin Kosek <mkosek@redhat.com>2012-01-20 16:28:23 +0100
commit64cf8a467c7d26b441f326f8435a2cdbe25dfd06 (patch)
tree6cc4d8180cad0366627b8992e4f7f652a35e2aae /ipalib
parent8c230f1d7b3309c6590f28a65966515fb918e245 (diff)
downloadfreeipa.git-64cf8a467c7d26b441f326f8435a2cdbe25dfd06.tar.gz
freeipa.git-64cf8a467c7d26b441f326f8435a2cdbe25dfd06.tar.xz
freeipa.git-64cf8a467c7d26b441f326f8435a2cdbe25dfd06.zip
Improve host-add error message
host-add command allows to add a host and its IP address via --ip-address option. When the address is invalid, it throws an error and refuses to operate. However, the invalid IP address error message is always the same which is not right as it forces a user to guess the reason of rejection (loopback address, link-local address or invalid address at all was passed, etc.). This patch changes host-add validator to print the error message. https://fedorahosted.org/freeipa/ticket/2229
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/host.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index 33d60ad1..fb5f4ea2 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -203,8 +203,8 @@ def validate_ipaddr(ugettext, ipaddr):
"""
try:
ip = CheckedIPAddress(ipaddr, match_local=False)
- except:
- return _('invalid IP address')
+ except Exception, e:
+ return unicode(e)
return None