mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-09-03 20:52:56 -05:00
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
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user