Browse Source

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
Rodolfo Alonso Hernandez 1 month ago
parent
commit
1813ec74cc
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      neutron/agent/common/ovs_lib.py

+ 6
- 3
neutron/agent/common/ovs_lib.py View File

@@ -26,6 +26,7 @@ from neutron_lib.services.qos import constants as qos_constants
26 26
 from oslo_config import cfg
27 27
 from oslo_log import log as logging
28 28
 from oslo_utils import uuidutils
29
+from ovsdbapp.backend.ovs_idl import idlutils
29 30
 import six
30 31
 import tenacity
31 32
 
@@ -1005,8 +1006,7 @@ class OVSBridge(BaseOVS):
1005 1006
                 self._set_port_qos(port['name'])
1006 1007
             self.ovsdb.db_destroy('QoS', qos_id).execute(check_error=True)
1007 1008
             for queue_uuid in queues.values():
1008
-                self.ovsdb.db_destroy('Queue', queue_uuid).execute(
1009
-                    check_error=True)
1009
+                self._delete_queue(queue_uuid)
1010 1010
 
1011 1011
     def _update_queue(self, port_id, queue_num, max_kbps=None,
1012 1012
                       max_burst_kbps=None, min_kbps=None):
@@ -1059,7 +1059,10 @@ class OVSBridge(BaseOVS):
1059 1059
         return queues
1060 1060
 
1061 1061
     def _delete_queue(self, queue_id):
1062
-        self.ovsdb.db_destroy('Queue', queue_id).execute(check_error=True)
1062
+        try:
1063
+            self.ovsdb.db_destroy('Queue', queue_id).execute(check_error=True)
1064
+        except idlutils.RowNotFound:
1065
+            LOG.info('OVS Queue %s was already deleted', queue_id)
1063 1066
 
1064 1067
     def _update_qos(self, qos_id=None, queues=None):
1065 1068
         queues = queues or {}

Loading…
Cancel
Save