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
This commit is contained in:
Rodolfo Alonso Hernandez 2024-01-17 17:04:09 +00:00
parent 90ea96b290
commit de40bfbafb
1 changed files with 1 additions and 1 deletions

View File

@ -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):