mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-25 08:21:05 -06:00
move hostname validation from DNS to hosts
Validator is no more used in dns plugin Part of ticket: IPA should allow internationalized domain names https://fedorahosted.org/freeipa/ticket/3169 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
dafd162ae5
commit
0827b95d0a
@ -34,13 +34,12 @@ from ipalib.plugins.service import (split_principal, validate_certificate,
|
||||
set_kerberos_attrs)
|
||||
from ipalib.plugins.dns import (dns_container_exists, _record_types,
|
||||
add_records_for_host_validation, add_records_for_host,
|
||||
_hostname_validator, get_reverse_zone)
|
||||
from ipalib.plugins.dns import get_reverse_zone
|
||||
get_reverse_zone)
|
||||
from ipalib import _, ngettext
|
||||
from ipalib import x509
|
||||
from ipalib.request import context
|
||||
from ipalib.util import (normalize_sshpubkey, validate_sshpubkey_no_options,
|
||||
convert_sshpubkey_post)
|
||||
convert_sshpubkey_post, validate_hostname)
|
||||
from ipapython.ipautil import ipa_generate_password, CheckedIPAddress
|
||||
from ipapython.dnsutil import DNSName
|
||||
from ipapython.ssh import SSHPublicKey
|
||||
@ -215,6 +214,15 @@ def normalize_hostname(hostname):
|
||||
hostname = hostname.lower()
|
||||
return hostname
|
||||
|
||||
def _hostname_validator(ugettext, value):
|
||||
try:
|
||||
validate_hostname(value)
|
||||
except ValueError, e:
|
||||
return _('invalid domain-name: %s') \
|
||||
% unicode(e)
|
||||
|
||||
return None
|
||||
|
||||
class host(LDAPObject):
|
||||
"""
|
||||
Host object.
|
||||
|
Loading…
Reference in New Issue
Block a user