]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Retry on unassigned ofport instead of treating it as a failure
authorTerry Wilson <twilson@redhat.com>
Fri, 11 Jul 2014 23:55:30 +0000 (17:55 -0600)
committerTerry Wilson <twilson@redhat.com>
Mon, 29 Dec 2014 22:12:52 +0000 (15:12 -0700)
commitcd78c7cc11940ee2e46e55001b2cfa6fbf0f7159
treeba8b11b637fa0a920e0ab60078d8980a53538096
parent2fccc7ed2cec13cb87e987e0a57c3a17df89888b
Retry on unassigned ofport instead of treating it as a failure

Open vSwitch will return '[]' when querying an interface's ofport
when the ofport has not yet been assigned. This doesn't signal a
failure, but the get_port_ofport code was treating it as such.
This patch uses a decorator from python-retrying which has been
added as a dependency of oslo_concurrency and therefore packaged
everywhere. The call to fetch the ofport is retried until the
vsctl_timeout is reached and, on failure, INVALID_OFPORT is
returned.

The add_port function will attempt to delete the port if
INVALID_OFPORT is returned from get_port_ofport. add_port is also
extended to take optional Interface options so that the
add_tunnel_port and add_patch_port functions can reuse it instead
of just duplicating its functionality.

Closes-Bug: #1341020
Change-Id: Ifc52d8589c7aafd360893cb9c1cdcbf43b04ee2c
neutron/agent/linux/ovs_lib.py
neutron/plugins/ofagent/agent/ofa_neutron_agent.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/agent/linux/test_ovs_lib.py
neutron/tests/unit/ofagent/test_ofa_neutron_agent.py
neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py
requirements.txt