]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Don't unnecessarily loop through all ports/interfaces
authorTerry Wilson <twilson@redhat.com>
Sat, 20 Dec 2014 02:01:36 +0000 (19:01 -0700)
committerTerry Wilson <twilson@redhat.com>
Sat, 27 Dec 2014 07:33:41 +0000 (00:33 -0700)
commit3f0bf6cfac2e151d5a4a7f076062b3365bdbf457
treeb01260b973b88e51fc27005f0a0bca5de6a40f96
parent3ff7a49c5b3620442c5b6d9750f2d8f9bcd38c58
Don't unnecessarily loop through all ports/interfaces

The ovs-vsctl 'list' command can take a list of records as an
argument, so there is no need to manually loop through all records
discarding the ones with names that don't match the bridge's
port name list.

Also, since the data is returned as json, the ofport returned isn't
a string, so we don't have to convert it to int for testing.

Closes-Bug: #1404935
Change-Id: Ica20f8f8315196aa5a04657d28dde41a75f0368d
neutron/agent/linux/ovs_lib.py
neutron/tests/unit/agent/linux/test_ovs_lib.py