]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Parse JSON in ovs_lib.get_vif_port_by_id
authorSalvatore Orlando <salv.orlando@gmail.com>
Sun, 16 Feb 2014 23:47:34 +0000 (15:47 -0800)
committerSalvatore Orlando <salv.orlando@gmail.com>
Sun, 16 Feb 2014 23:55:18 +0000 (15:55 -0800)
commit3d24fe5710cbea6d7d1f88c3476f4a856347ab5e
tree0f723bd3e626654c5b185e4ec1f83354f4b4c75f
parent6e8aebac95122f092a90410630da65a92e52bc13
Parse JSON in ovs_lib.get_vif_port_by_id

This patch replaces regex matching of text output with parsing
of JSON output in ovs_lib.get_vif_port_by_id.
This makes the code more reliable as subtle, possibly even
cosmetic, changes in ovs-vsctl output format could cause the
regular expression match to fail.

Also, this makes the code consistent with ovs_lib.get_vif_port_set
which already uses JSON output.

Finally this patch slightly changes the behaviour of
ovs_lib.get_vif_port_by_id returning None if elements such as
mac address or ofport were not available.

Change-Id: Ia985a130739c72b5b88414a79b2c6083ca6a0a00
Closes-Bug: #1280827
neutron/agent/linux/ovs_lib.py
neutron/tests/unit/openvswitch/test_ovs_lib.py