]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Handle no ofport in get_vif_port_to_ofport_map
authorKevin Benton <blak111@gmail.com>
Tue, 31 Mar 2015 03:29:51 +0000 (20:29 -0700)
committerKevin Benton <kevinbenton@buttewifi.com>
Fri, 24 Apr 2015 01:46:16 +0000 (01:46 +0000)
commit1c1981e3ce16e73499bf3f9064e7f366c057ab74
treefad6d61c7a97fb2ac521150161d07284ba83b76a
parent9e113360b9ab55793a1b5d8fc0cb3e428e63c044
Handle no ofport in get_vif_port_to_ofport_map

Newly added ports to OVSDB might not yet have an
ofport number assigned to them. This causes the
return from the DB query to return a list instead
of a port number.

This patch handles that by attempting to convert
each result into an integer and then catching the
exception and continuing through the iteration to
ignore uninitialized ports like these.

It also adds a unit test based on data from a
failure observed in the gate.

Change-Id: I5c1bc8363cc7b07a03df12e3ccd49a09b1907ad2
Closes-Bug: #1444269
(cherry picked from commit e7e2609fae70dbffa0ddbf37c7804587e216648c)
neutron/agent/common/ovs_lib.py
neutron/tests/unit/agent/common/test_ovs_lib.py