]> 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 <blak111@gmail.com>
Tue, 31 Mar 2015 03:36:59 +0000 (20:36 -0700)
commite7e2609fae70dbffa0ddbf37c7804587e216648c
tree3cfe15a5ab527321ac8874cd255d437a006ef1fb
parent72c09c24c20a13d643141860e609f50af38b6e16
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
neutron/agent/common/ovs_lib.py
neutron/tests/unit/agent/common/test_ovs_lib.py