Merge "Add retry decorator update_segment_host_mapping()"
This commit is contained in:
commit
68ca126c9a
|
@ -20,6 +20,7 @@ from neutron_lib.callbacks import resources
|
|||
from neutron_lib import constants
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from neutron_lib.plugins import directory
|
||||
from oslo_concurrency import lockutils
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -180,6 +181,8 @@ class SegmentDbMixin(common_db_mixin.CommonDbMixin):
|
|||
segment=segment_dict)
|
||||
|
||||
|
||||
@db_api.retry_if_session_inactive()
|
||||
@lockutils.synchronized('update_segment_host_mapping')
|
||||
def update_segment_host_mapping(context, host, current_segment_ids):
|
||||
with db_api.context_manager.writer.using(context):
|
||||
segment_host_mapping = network.SegmentHostMapping.get_objects(
|
||||
|
|
Loading…
Reference in New Issue