Merge "Ensure driver error preventing trunk port deletion is logged" into stable/rocky
This commit is contained in:
commit
49fef15c48
@ -23,6 +23,7 @@ from neutron_lib import context
|
||||
from neutron_lib.plugins import directory
|
||||
from neutron_lib.services import base as service_base
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from neutron.db import _resource_extend as resource_extend
|
||||
@ -269,15 +270,24 @@ class TrunkPlugin(service_base.ServicePluginBase,
|
||||
# object disappears from the datastore, therefore there is no
|
||||
# status transition involved. If PRECOMMIT failures occur,
|
||||
# the trunk remains in the status where it was.
|
||||
trunk.delete()
|
||||
try:
|
||||
trunk.delete()
|
||||
except Exception as e:
|
||||
with excutils.save_and_reraise_exception():
|
||||
LOG.warning('Trunk driver raised exception when '
|
||||
'deleting trunk port %s: %s', trunk_id,
|
||||
str(e))
|
||||
payload = callbacks.TrunkPayload(context, trunk_id,
|
||||
original_trunk=trunk)
|
||||
registry.notify(constants.TRUNK, events.PRECOMMIT_DELETE, self,
|
||||
payload=payload)
|
||||
else:
|
||||
LOG.info('Trunk driver does not consider trunk %s '
|
||||
'untrunkable', trunk_id)
|
||||
raise trunk_exc.TrunkInUse(trunk_id=trunk_id)
|
||||
registry.notify(constants.TRUNK, events.AFTER_DELETE, self,
|
||||
payload=payload)
|
||||
registry.notify(constants.TRUNK,
|
||||
events.AFTER_DELETE,
|
||||
self, payload=payload)
|
||||
|
||||
@db_base_plugin_common.convert_result_to_dict
|
||||
def add_subports(self, context, trunk_id, subports):
|
||||
|
Loading…
x
Reference in New Issue
Block a user