oslo.serialization/oslo_serialization
Ihar Hrachyshka be828c35d8 Don't iterate through addresses in netaddr.IPNetwork
Currently, to_primitive tries to iterate through all addresses in the
network, because the type doesn't have a special handling that would
short curcuit it, but also has __iter__. This may be detrimental to
performance, up to the point of node crash due to memory exhaustion if
the passed network range is too large (think of 0.0.0.0/0 or even
2001::/64). This behavior also makes it impossible to restore the
original data format (CIDR).

This patch short curcuits the iteration by handling the IPNetwork type
as a special case, same as we do for IPAddress.

Change-Id: I6aecd2d057d282a655ff9e4918c164253142b188
Closes-Bug: #1698355
(cherry picked from commit 38ac21b523)
2017-09-05 11:58:24 +00:00
..
serializer Unified and simplified API for all serializers 2016-04-04 15:27:16 +03:00
tests Don't iterate through addresses in netaddr.IPNetwork 2017-09-05 11:58:24 +00:00
__init__.py Move files out of the namespace package 2015-01-05 15:40:06 -05:00
base64.py Prefer raising the python2.x type error for b64 decode errors 2017-01-09 16:37:28 -08:00
jsonutils.py Don't iterate through addresses in netaddr.IPNetwork 2017-09-05 11:58:24 +00:00
msgpackutils.py Replace six.iteritems() with .items() 2016-12-12 11:11:28 +08:00