commit 8ecb28dd09aedc0df6b91af4712aa8469a90e850
Author: Martin Hickey <email address hidden>
Date: Thu Mar 3 12:20:27 2016 +0000
Integrate the port allowed address pairs VersionedObject in Neutron
This patch is dependent on commit I8d03528f8f45f5f50fa467b39245a513a37c5d89.
It integrates the VersionedObject with the existing code.
Integration revealed that using IPAddress is not correct for allowed
address pairs, because the address can also represent a subnet.
Another issue revealed by the integration is that we must retain the
original string format passed by users through API for MAC addresses.
Neither we can use IPNetworkField from oslo.versionedobjects for
ip_address field because it will then always append prefix length to
base network address, even if prefix length is maximum for the type of
IP network (meaning, the address actually represents a single host),
which is contradictory to how API currently behaves (returning mask-less
addresses for /32 - for ipv4 - and /128 - for ipv6 - prefix lengths).
To solve those issues, 'authentic' flavors for netaddr.EUI and
netaddr.IPNetwork types are introduced. Those 'authentic' flavors
attempt to retain the original string representation, as passed by the
caller.
Since base IPNetworkField recreates network object on coerce(), and
hence looses information about the original string representation, we
introduce our custom flavor of the field type that reuses the network
object passed by the caller.
The change for the type of ip_address field triggers hash change.
Anyway, we are safe to change it without considering backwards
compatibility, because the object is not used anywhere yet.
Reviewed: https:/ /review. openstack. org/287756 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=8ecb28dd09a edc0df6b91af471 2aa8469a90e850
Committed: https:/
Submitter: Jenkins
Branch: master
commit 8ecb28dd09aedc0 df6b91af4712aa8 469a90e850
Author: Martin Hickey <email address hidden>
Date: Thu Mar 3 12:20:27 2016 +0000
Integrate the port allowed address pairs VersionedObject in Neutron
This patch is dependent on commit I8d03528f8f45f5 f50fa467b39245a 513a37c5d89.
It integrates the VersionedObject with the existing code.
Integration revealed that using IPAddress is not correct for allowed
address pairs, because the address can also represent a subnet.
Another issue revealed by the integration is that we must retain the
original string format passed by users through API for MAC addresses.
Neither we can use IPNetworkField from oslo.versionedo bjects for
ip_address field because it will then always append prefix length to
base network address, even if prefix length is maximum for the type of
IP network (meaning, the address actually represents a single host),
which is contradictory to how API currently behaves (returning mask-less
addresses for /32 - for ipv4 - and /128 - for ipv6 - prefix lengths).
To solve those issues, 'authentic' flavors for netaddr.EUI and IPNetwork types are introduced. Those 'authentic' flavors
netaddr.
attempt to retain the original string representation, as passed by the
caller.
Since base IPNetworkField recreates network object on coerce(), and
hence looses information about the original string representation, we
introduce our custom flavor of the field type that reuses the network
object passed by the caller.
The change for the type of ip_address field triggers hash change.
Anyway, we are safe to change it without considering backwards
compatibility, because the object is not used anywhere yet.
Co-Authored-By: Ihar Hrachyshka <email address hidden> d510373616713b3 fa9517c18ac
Change-Id: I3c937267ce789e
Partial-Bug: #1541928