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.
Reviewed: https:/ /review. openstack. org/392931 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=d400c04095e 1e09468b3bd009a e7004b400fddea
Committed: https:/
Submitter: Jenkins
Branch: master
commit d400c04095e1e09 468b3bd009ae700 4b400fddea
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 43e6900702249e6 9d3946faa19
Change-Id: Ic0032e3fc12de6