Merge "[sqlalchemy-20] Remove retry decorator from update_floatingip_status"

This commit is contained in:
Zuul 2022-07-08 14:28:37 +00:00 committed by Gerrit Code Review
commit 497d1fd310
2 changed files with 8 additions and 2 deletions

View File

@ -1551,7 +1551,6 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
context, id, floatingip)
return floatingip
@db_api.retry_if_session_inactive()
def update_floatingip_status(self, context, floatingip_id, status):
"""Update operational status for floating IP in neutron DB."""
return l3_obj.FloatingIP.update_object(

View File

@ -22,6 +22,7 @@ from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const
from neutron_lib import context as n_context
from neutron_lib.db import api as db_api
from neutron_lib import exceptions as n_exc
from neutron_lib.exceptions import availability_zone as az_exc
from neutron_lib.plugins import constants as plugin_constants
@ -288,11 +289,17 @@ class OVNL3RouterPlugin(service_base.ServicePluginBase,
return fip
def update_floatingip_status(self, context, floatingip_id, status):
fip = super(OVNL3RouterPlugin, self).update_floatingip_status(
fip = self.update_floatingip_status_retry(
context, floatingip_id, status)
self._ovn_client.update_floatingip_status(context, fip)
return fip
@db_api.retry_if_session_inactive()
def update_floatingip_status_retry(self, context, floatingip_id, status):
with db_api.CONTEXT_WRITER.using(context):
return super(OVNL3RouterPlugin, self).update_floatingip_status(
context, floatingip_id, status)
def disassociate_floatingips(self, context, port_id, do_notify=True):
fips = self.get_floatingips(context.elevated(),
filters={'port_id': [port_id]})