From d914ffd32bfbed8a36f5207150e7ed3dfed2c9ea Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Fri, 11 Jul 2014 17:55:30 -0600 Subject: [PATCH] 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 --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 6ec1141..cc6689f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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