diff options
author | Lynn Root <lroot@redhat.com> | 2012-11-08 10:06:35 -0500 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-12-11 10:52:06 +0100 |
commit | 173ee4d141958f198a706d65d4ee47c4a2ec31ed (patch) | |
tree | f03ad715dfa5f57ce676327f709831264d54612f /ipalib/plugins/dns.py | |
parent | 585b91df3b1fab9c865e00f522950003709ea23d (diff) | |
download | freeipa-173ee4d141958f198a706d65d4ee47c4a2ec31ed.tar.gz freeipa-173ee4d141958f198a706d65d4ee47c4a2ec31ed.tar.xz freeipa-173ee4d141958f198a706d65d4ee47c4a2ec31ed.zip |
Switch %r specifiers to '%s' in Public errors
This switch drops the preceding 'u' from strings within Public error messages.
This patch also addresses the related unfriendly 'u' from re-raising errors from netaddr.IPAddress by passing a bytestring through the function.
Also switched ValidationError to TypeError in validate_scalar per jcholast@redhat.com.
Ticket: https://fedorahosted.org/freeipa/ticket/3121
Ticket: https://fedorahosted.org/freeipa/ticket/2588
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r-- | ipalib/plugins/dns.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index 17a794b5..ae72f305 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -267,7 +267,7 @@ def _create_zone_serial(): def _reverse_zone_name(netstr): try: - netaddr.IPAddress(netstr) + netaddr.IPAddress(str(netstr)) except (netaddr.AddrFormatError, ValueError): pass else: @@ -285,7 +285,7 @@ def _reverse_zone_name(netstr): def _validate_ipaddr(ugettext, ipaddr, ip_version=None): try: - ip = netaddr.IPAddress(ipaddr, flags=netaddr.INET_PTON) + ip = netaddr.IPAddress(str(ipaddr), flags=netaddr.INET_PTON) if ip_version is not None: if ip.version != ip_version: @@ -454,7 +454,7 @@ def add_forward_record(zone, name, str_address): pass # the entry already exists and matches def get_reverse_zone(ipaddr, prefixlen=None): - ip = netaddr.IPAddress(ipaddr) + ip = netaddr.IPAddress(str(ipaddr)) revdns = unicode(ip.reverse_dns) if prefixlen is None: |