From de40bfbafb03fcb14299cd5da4459d3927aaaef3 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Wed, 17 Jan 2024 17:04:09 +0000 Subject: [PATCH] Update exception conditions in ``_process_create_port`` This is a follow-up patch to handle a missing comment. The except branch should never catch a ``AttributeError`` exception, only a ``KeyError`` if that is missing in the ``data`` dictionary. Related-Bug: #2013228 Change-Id: I6a3249649dde58e666048a613640338ea8af7b36 --- neutron/db/port_hardware_offload_type_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/db/port_hardware_offload_type_db.py b/neutron/db/port_hardware_offload_type_db.py index 0776db5bf8f..21447e82f6d 100644 --- a/neutron/db/port_hardware_offload_type_db.py +++ b/neutron/db/port_hardware_offload_type_db.py @@ -41,7 +41,7 @@ class PortHardwareOffloadTypeDbMixin(object): if hw_type not in capabilities: capabilities.append(hw_type) data[portbindings.PROFILE]['capabilities'] = capabilities - except (KeyError, AttributeError): + except KeyError: data[portbindings.PROFILE] = {'capabilities': [hw_type]} def _extend_port_dict(self, port_db, result):