From 1813ec74cc583dcbf7097ded938bc94495ce6fed Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Mon, 11 Mar 2019 15:43:48 +0000 Subject: [PATCH] Do not rise exception if OVS Queue is not present when being deleted In this case, there is no need to raise an exception because the Queue is not present anymore in the OVS database. A warning message will be logged. Change-Id: I836e762bf0703d53f47877b73354948cba70e9c2 Closes-Bug: #1819477 --- neutron/agent/common/ovs_lib.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/neutron/agent/common/ovs_lib.py b/neutron/agent/common/ovs_lib.py index d8bf41fb27a..995a5ec662f 100644 --- a/neutron/agent/common/ovs_lib.py +++ b/neutron/agent/common/ovs_lib.py @@ -26,6 +26,7 @@ from neutron_lib.services.qos import constants as qos_constants from oslo_config import cfg from oslo_log import log as logging from oslo_utils import uuidutils +from ovsdbapp.backend.ovs_idl import idlutils import six import tenacity @@ -1005,8 +1006,7 @@ class OVSBridge(BaseOVS): self._set_port_qos(port['name']) self.ovsdb.db_destroy('QoS', qos_id).execute(check_error=True) for queue_uuid in queues.values(): - self.ovsdb.db_destroy('Queue', queue_uuid).execute( - check_error=True) + self._delete_queue(queue_uuid) def _update_queue(self, port_id, queue_num, max_kbps=None, max_burst_kbps=None, min_kbps=None): @@ -1059,7 +1059,10 @@ class OVSBridge(BaseOVS): return queues def _delete_queue(self, queue_id): - self.ovsdb.db_destroy('Queue', queue_id).execute(check_error=True) + try: + self.ovsdb.db_destroy('Queue', queue_id).execute(check_error=True) + except idlutils.RowNotFound: + LOG.info('OVS Queue %s was already deleted', queue_id) def _update_qos(self, qos_id=None, queues=None): queues = queues or {}