mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06: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:
@@ -103,7 +103,7 @@ class CheckedIPAddress(netaddr.IPAddress):
|
||||
else:
|
||||
try:
|
||||
try:
|
||||
addr = netaddr.IPAddress(addr, flags=self.netaddr_ip_flags)
|
||||
addr = netaddr.IPAddress(str(addr), flags=self.netaddr_ip_flags)
|
||||
except netaddr.AddrFormatError:
|
||||
# netaddr.IPAddress doesn't handle zone indices in textual
|
||||
# IPv6 addresses. Try removing zone index and parse the
|
||||
@@ -113,11 +113,11 @@ class CheckedIPAddress(netaddr.IPAddress):
|
||||
addr, sep, foo = addr.partition('%')
|
||||
if sep != '%':
|
||||
raise
|
||||
addr = netaddr.IPAddress(addr, flags=self.netaddr_ip_flags)
|
||||
addr = netaddr.IPAddress(str(addr), flags=self.netaddr_ip_flags)
|
||||
if addr.version != 6:
|
||||
raise
|
||||
except ValueError:
|
||||
net = netaddr.IPNetwork(addr, flags=self.netaddr_ip_flags)
|
||||
net = netaddr.IPNetwork(str(addr), flags=self.netaddr_ip_flags)
|
||||
if not parse_netmask:
|
||||
raise ValueError("netmask and prefix length not allowed here")
|
||||
addr = net.ip
|
||||
|
||||
Reference in New Issue
Block a user