Merge "Wait before deleting trunk bridges for DPDK vhu" into stable/rocky

This commit is contained in:
Zuul 2020-04-16 05:08:44 +00:00 committed by Gerrit Code Review
commit add8d7455d
1 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,7 @@
# under the License. # under the License.
import functools import functools
import time
import eventlet import eventlet
from neutron_lib.callbacks import events from neutron_lib.callbacks import events
@ -42,6 +43,7 @@ from neutron.services.trunk.rpc import agent
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
DEFAULT_WAIT_FOR_PORT_TIMEOUT = 60 DEFAULT_WAIT_FOR_PORT_TIMEOUT = 60
WAIT_BEFORE_TRUNK_DELETE = 3
def lock_on_bridge_name(required_parameter): def lock_on_bridge_name(required_parameter):
@ -215,6 +217,7 @@ class OVSDBHandler(object):
# try to mitigate the issue by checking if there is a port on the # try to mitigate the issue by checking if there is a port on the
# bridge and if so then do not remove it. # bridge and if so then do not remove it.
bridge = ovs_lib.OVSBridge(bridge_name) bridge = ovs_lib.OVSBridge(bridge_name)
time.sleep(WAIT_BEFORE_TRUNK_DELETE)
if bridge_has_instance_port(bridge): if bridge_has_instance_port(bridge):
LOG.debug("The bridge %s has instances attached so it will not " LOG.debug("The bridge %s has instances attached so it will not "
"be deleted.", bridge_name) "be deleted.", bridge_name)