Comment 34 for bug 1541928

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/287756
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=8ecb28dd09aedc0df6b91af4712aa8469a90e850
Submitter: Jenkins
Branch: master

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.

    Co-Authored-By: Ihar Hrachyshka <email address hidden>
    Change-Id: I3c937267ce789ed510373616713b3fa9517c18ac
    Partial-Bug: #1541928