Merge "Use correct retry mechanism in tags"

This commit is contained in:
Jenkins 2017-03-17 08:40:32 +00:00 committed by Gerrit Code Review
commit 038597e794
1 changed files with 1 additions and 5 deletions

View File

@ -15,8 +15,6 @@
import functools
from neutron_lib.plugins import directory
from oslo_db import api as oslo_db_api
from oslo_db import exception as db_exc
from oslo_log import helpers as log_helpers
from sqlalchemy.orm import exc
@ -79,9 +77,7 @@ class TagPlugin(common_db_mixin.CommonDbMixin, tag_ext.TagPluginBase):
raise tag_ext.TagNotFound(tag=tag)
@log_helpers.log_method_call
@oslo_db_api.wrap_db_retry(
max_retries=db_api.MAX_RETRIES,
exception_checker=lambda e: isinstance(e, db_exc.DBDuplicateEntry))
@db_api.retry_if_session_inactive()
def update_tags(self, context, resource, resource_id, body):
with db_api.context_manager.writer.using(context):
# We get and do all operations with objects in one session