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
This commit is contained in:
Terry Wilson
2014-07-11 17:55:30 -06:00
parent 9a0d8b472e
commit d914ffd32b

View File

@@ -15,6 +15,7 @@ Jinja2>=2.6 # BSD License (3 clause)
keystonemiddleware>=1.0.0
netaddr>=0.7.12
python-neutronclient>=2.3.6,<3
retrying>=1.2.3,!=1.3.0 # Apache-2.0
SQLAlchemy>=0.9.7,<=0.9.99
WebOb>=1.2.3
python-keystoneclient>=0.11.1