This function isn't necessary. The json encoding of a
named tuple will already turn into a normal list.
ports = [l2pop_rpc.PortInfo('abcdef', '1.1.1.1')]
json.dumps(ports) == json.dumps([(mac, ip) for (mac, ip) in ports])
An argument could be made that the PortInfo object could have
something added to it later that we wouldn't want to serialize
in order to remain backward compatible. However, doing so would
break all of the constructions of PortInfo objects on the agents
once they got the updated code for PortInfo that requires the
new parameter.
So there is no way currently to add a new field to PortInfo without
breaking existing legacy clients or breaking new clients.
Given that, let's stop doing the json encoder's job.
This patch also adds a sanity unit test to make sure the json
serialization method used in oslo does not break on the named tuples.
Change-Id: I45ae69ef8c9c15ad21a28dc42f2d78b234ccfb0c