Comment 2 for bug 1638664

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

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

commit d400c04095e1e09468b3bd009ae7004b400fddea
Author: Kevin Benton <email address hidden>
Date: Wed Nov 2 11:38:15 2016 -0700

    Add 'to_primitive' for MACAddress and IPNetwork

    Both of these OVO common types did not have a to_primitive
    method, so their native netaddr objects were being passed
    to the json serializer.

    For the MACAdddress object, this resulted in an traceback
    because EUI types are not json encodable. For the IPNetwork,
    this resulted in a list of every IP address in the network.

    This fixes both by adding a 'to_primitive' method that calls
    str on the netaddr objects, which results in sane representations
    (string mac address and string CIDR).

    This adds a base test the common types test case to ensure
    all primitive representations are json serializable.

    Closes-Bug: #1638664
    Change-Id: Ic0032e3fc12de643e6900702249e69d3946faa19