[aim] Use retry_if_session_inactive in mitaka
Both the ml2plus core plugin and grouppolicy service plugin use the retry_if_session_inactive decorator from newton. Change-Id: I3047446068bd6be449d830018b5a1ef31233fdf9
This commit is contained in:
parent
b41c3fc959
commit
a867f38b97
|
@ -0,0 +1,63 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.db import api as db_api
|
||||
from oslo_db import api as oslo_db_api
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_log import log as logging
|
||||
from sqlalchemy.orm import exc
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def patched_is_nested_instance(e, etypes):
|
||||
"""Check if exception or its inner excepts are an instance of etypes."""
|
||||
LOG.debug("Using patched_is_nested_instance")
|
||||
if etypes != db_exc.DBError:
|
||||
etypes = etypes + (db_exc.DBDeadlock, exc.StaleDataError,
|
||||
db_exc.DBConnectionError, db_exc.DBDuplicateEntry,
|
||||
db_exc.RetryRequest, )
|
||||
etypes = tuple(set(etypes))
|
||||
|
||||
return (isinstance(e, etypes) or
|
||||
isinstance(e, n_exc.MultipleExceptions) and
|
||||
any(patched_is_nested_instance(
|
||||
i, etypes) for i in e.inner_exceptions))
|
||||
|
||||
|
||||
db_api.is_nested_instance = patched_is_nested_instance
|
||||
|
||||
|
||||
# Use newton version on mitaka. No patch needed on newer branches.
|
||||
def patched_is_retriable(e):
|
||||
LOG.debug("Using patched_is_retriable")
|
||||
if getattr(e, '_RETRY_EXCEEDED', False):
|
||||
return False
|
||||
if db_api._is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,
|
||||
db_exc.DBConnectionError,
|
||||
db_exc.DBDuplicateEntry,
|
||||
db_exc.RetryRequest)):
|
||||
return True
|
||||
# looking savepoints mangled by deadlocks. see bug/1590298 for details.
|
||||
return patched_is_nested_instance(e, db_exc.DBError) and '1305' in str(e)
|
||||
|
||||
|
||||
db_api.is_retriable = patched_is_retriable
|
||||
|
||||
|
||||
db_api.retry_db_errors = oslo_db_api.wrap_db_retry(
|
||||
max_retries=10,
|
||||
retry_on_request=True,
|
||||
exception_checker=patched_is_retriable
|
||||
)
|
|
@ -16,6 +16,7 @@
|
|||
from neutron._i18n import _LE
|
||||
from neutron._i18n import _LI
|
||||
from neutron.api.v2 import attributes
|
||||
from neutron.db import api as db_api
|
||||
from neutron.db import db_base_plugin_v2
|
||||
from neutron.db import models_v2
|
||||
from neutron.db import securitygroups_db
|
||||
|
@ -27,6 +28,8 @@ from neutron.quota import resource_registry
|
|||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from oslo_utils import excutils
|
||||
from pecan import util as p_util
|
||||
import six
|
||||
from sqlalchemy import inspect
|
||||
|
||||
from gbpservice.neutron.db import implicitsubnetpool_db
|
||||
|
@ -93,6 +96,43 @@ opts = [
|
|||
cfg.CONF.register_opts(opts, "ml2plus")
|
||||
|
||||
|
||||
# Copied from newton version of neutron/db/api.py.
|
||||
def retry_if_session_inactive(context_var_name='context'):
|
||||
"""Retries only if the session in the context is inactive.
|
||||
|
||||
Calls a retry_db_errors wrapped version of the function if the context's
|
||||
session passed in is inactive, otherwise it just calls the function
|
||||
directly. This is useful to avoid retrying things inside of a transaction
|
||||
which is ineffective for DB races/errors.
|
||||
|
||||
This should be used in all cases where retries are desired and the method
|
||||
accepts a context.
|
||||
"""
|
||||
def decorator(f):
|
||||
try:
|
||||
# NOTE(kevinbenton): we use pecan's util function here because it
|
||||
# deals with the horrors of finding args of already decorated
|
||||
# functions
|
||||
ctx_arg_index = p_util.getargspec(f).args.index(context_var_name)
|
||||
except ValueError:
|
||||
raise RuntimeError(_LE("Could not find position of var %s")
|
||||
% context_var_name)
|
||||
f_with_retry = db_api.retry_db_errors(f)
|
||||
|
||||
@six.wraps(f)
|
||||
def wrapped(*args, **kwargs):
|
||||
# only use retry wrapper if we aren't nested in an active
|
||||
# transaction
|
||||
if context_var_name in kwargs:
|
||||
context = kwargs[context_var_name]
|
||||
else:
|
||||
context = args[ctx_arg_index]
|
||||
method = f if context.session.is_active else f_with_retry
|
||||
return method(*args, **kwargs)
|
||||
return wrapped
|
||||
return decorator
|
||||
|
||||
|
||||
class Ml2PlusPlugin(ml2_plugin.Ml2Plugin,
|
||||
implicitsubnetpool_db.ImplicitSubnetpoolMixin):
|
||||
|
||||
|
@ -206,36 +246,110 @@ class Ml2PlusPlugin(ml2_plugin.Ml2Plugin,
|
|||
address_scope)
|
||||
return self._fields(res, fields)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def create_network(self, context, network):
|
||||
self._ensure_tenant(context, network[attributes.NETWORK])
|
||||
return super(Ml2PlusPlugin, self).create_network(context, network)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def update_network(self, context, id, network):
|
||||
return super(Ml2PlusPlugin, self).update_network(context, id, network)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def get_network(self, context, id, fields=None):
|
||||
return super(Ml2PlusPlugin, self).get_network(context, id, fields)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def get_networks(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None, page_reverse=False):
|
||||
return super(Ml2PlusPlugin, self).get_networks(
|
||||
context, filters, fields, sorts, limit, marker, page_reverse)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def delete_network(self, context, id):
|
||||
return super(Ml2PlusPlugin, self).delete_network(context, id)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def create_network_bulk(self, context, networks):
|
||||
self._ensure_tenant_bulk(context, networks[attributes.NETWORKS],
|
||||
attributes.NETWORK)
|
||||
return super(Ml2PlusPlugin, self).create_network_bulk(context,
|
||||
networks)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def create_subnet(self, context, subnet):
|
||||
self._ensure_tenant(context, subnet[attributes.SUBNET])
|
||||
return super(Ml2PlusPlugin, self).create_subnet(context, subnet)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def update_subnet(self, context, id, subnet):
|
||||
return super(Ml2PlusPlugin, self).update_subnet(context, id, subnet)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def get_subnet(self, context, id, fields=None):
|
||||
return super(Ml2PlusPlugin, self).get_subnet(context, id, fields)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def get_subnets(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None, page_reverse=False):
|
||||
return super(Ml2PlusPlugin, self).get_subnets(
|
||||
context, filters, fields, sorts, limit, marker, page_reverse)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def delete_subnet(self, context, id):
|
||||
return super(Ml2PlusPlugin, self).delete_subnet(context, id)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def create_subnet_bulk(self, context, subnets):
|
||||
self._ensure_tenant_bulk(context, subnets[attributes.SUBNETS],
|
||||
attributes.SUBNET)
|
||||
return super(Ml2PlusPlugin, self).create_subnet_bulk(context,
|
||||
subnets)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def create_port(self, context, port):
|
||||
self._ensure_tenant(context, port[attributes.PORT])
|
||||
return super(Ml2PlusPlugin, self).create_port(context, port)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def create_port_bulk(self, context, ports):
|
||||
self._ensure_tenant_bulk(context, ports[attributes.PORTS],
|
||||
attributes.PORT)
|
||||
return super(Ml2PlusPlugin, self).create_port_bulk(context,
|
||||
ports)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def update_port(self, context, id, port):
|
||||
return super(Ml2PlusPlugin, self).update_port(context, id, port)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def delete_port(self, context, id, l3_port_check=True):
|
||||
return super(Ml2PlusPlugin, self).delete_port(
|
||||
context, id, l3_port_check=l3_port_check)
|
||||
|
||||
@retry_if_session_inactive(context_var_name='plugin_context')
|
||||
def get_bound_port_context(self, plugin_context, port_id, host=None,
|
||||
cached_networks=None):
|
||||
return super(Ml2PlusPlugin, self).get_bound_port_context(
|
||||
plugin_context, port_id, host, cached_networks)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def update_port_status(self, context, port_id, status, host=None,
|
||||
network=None):
|
||||
return super(Ml2PlusPlugin, self).update_port_status(
|
||||
context, port_id, status, host, network)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def port_bound_to_host(self, context, port_id, host):
|
||||
return super(Ml2PlusPlugin, self).port_bound_to_host(
|
||||
context, port_id, host)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def get_ports_from_devices(self, context, devices):
|
||||
return super(Ml2PlusPlugin, self).get_ports_from_devices(
|
||||
context, devices)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def create_subnetpool(self, context, subnetpool):
|
||||
self._ensure_tenant(context, subnetpool[attributes.SUBNETPOOL])
|
||||
session = context.session
|
||||
|
@ -260,6 +374,7 @@ class Ml2PlusPlugin(ml2_plugin.Ml2Plugin,
|
|||
|
||||
# REVISIT(rkukura): Is create_subnetpool_bulk() needed?
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def update_subnetpool(self, context, id, subnetpool):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -279,6 +394,18 @@ class Ml2PlusPlugin(ml2_plugin.Ml2Plugin,
|
|||
self.mechanism_manager.update_subnetpool_postcommit(mech_context)
|
||||
return updated_subnetpool
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def get_subnetpool(self, context, id, fields=None):
|
||||
return super(Ml2PlusPlugin, self).get_subnetpool(context, id, fields)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def get_subnetpools(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
return super(Ml2PlusPlugin, self).get_subnetpools(
|
||||
context, filters, fields, sorts, limit, marker, page_reverse)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def delete_subnetpool(self, context, id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -295,6 +422,7 @@ class Ml2PlusPlugin(ml2_plugin.Ml2Plugin,
|
|||
result['is_implicit'] = (
|
||||
self.update_implicit_subnetpool(context, result))
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def create_address_scope(self, context, address_scope):
|
||||
self._ensure_tenant(context, address_scope[as_ext.ADDRESS_SCOPE])
|
||||
session = context.session
|
||||
|
@ -321,6 +449,7 @@ class Ml2PlusPlugin(ml2_plugin.Ml2Plugin,
|
|||
|
||||
# REVISIT(rkukura): Is create_address_scope_bulk() needed?
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def update_address_scope(self, context, id, address_scope):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -339,6 +468,19 @@ class Ml2PlusPlugin(ml2_plugin.Ml2Plugin,
|
|||
self.mechanism_manager.update_address_scope_postcommit(mech_context)
|
||||
return updated_address_scope
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def get_address_scope(self, context, id, fields=None):
|
||||
return super(Ml2PlusPlugin, self).get_address_scope(
|
||||
context, id, fields)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def get_address_scopes(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
return super(Ml2PlusPlugin, self).get_address_scopes(
|
||||
context, filters, fields, sorts, limit, marker, page_reverse)
|
||||
|
||||
@retry_if_session_inactive()
|
||||
def delete_address_scope(self, context, id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.db import api as db_api
|
||||
from oslo_db import api as oslo_db_api
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_log import log as logging
|
||||
from sqlalchemy.orm import exc
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def patched_is_nested_instance(e, etypes):
|
||||
"""Check if exception or its inner excepts are an instance of etypes."""
|
||||
LOG.debug("Using patched_is_nested_instance")
|
||||
if etypes != db_exc.DBError:
|
||||
etypes = etypes + (db_exc.DBDeadlock, exc.StaleDataError,
|
||||
db_exc.DBConnectionError, db_exc.DBDuplicateEntry,
|
||||
db_exc.RetryRequest, )
|
||||
etypes = tuple(set(etypes))
|
||||
|
||||
return (isinstance(e, etypes) or
|
||||
isinstance(e, n_exc.MultipleExceptions) and
|
||||
any(patched_is_nested_instance(
|
||||
i, etypes) for i in e.inner_exceptions))
|
||||
|
||||
|
||||
db_api.is_nested_instance = patched_is_nested_instance
|
||||
|
||||
|
||||
# Use newton version on mitaka. No patch needed on newer branches.
|
||||
def patched_is_retriable(e):
|
||||
LOG.debug("Using patched_is_retriable")
|
||||
if getattr(e, '_RETRY_EXCEEDED', False):
|
||||
return False
|
||||
if db_api._is_nested_instance(e, (db_exc.DBDeadlock, exc.StaleDataError,
|
||||
db_exc.DBConnectionError,
|
||||
db_exc.DBDuplicateEntry,
|
||||
db_exc.RetryRequest)):
|
||||
return True
|
||||
# looking savepoints mangled by deadlocks. see bug/1590298 for details.
|
||||
return patched_is_nested_instance(e, db_exc.DBError) and '1305' in str(e)
|
||||
|
||||
|
||||
db_api.is_retriable = patched_is_retriable
|
||||
|
||||
|
||||
db_api.retry_db_errors = oslo_db_api.wrap_db_retry(
|
||||
max_retries=10,
|
||||
retry_on_request=True,
|
||||
exception_checker=patched_is_retriable
|
||||
)
|
|
@ -24,6 +24,8 @@ from neutron.quota import resource_registry
|
|||
from oslo_log import helpers as log
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
from pecan import util as p_util
|
||||
import six
|
||||
|
||||
from gbpservice.common import utils as gbp_utils
|
||||
from gbpservice.neutron.db.grouppolicy import group_policy_db as gpdb
|
||||
|
@ -48,6 +50,43 @@ STATUS_DETAILS = 'status_details'
|
|||
STATUS_SET = set([STATUS, STATUS_DETAILS])
|
||||
|
||||
|
||||
# Copied from newton version of neutron/db/api.py.
|
||||
def retry_if_session_inactive(context_var_name='context'):
|
||||
"""Retries only if the session in the context is inactive.
|
||||
|
||||
Calls a retry_db_errors wrapped version of the function if the context's
|
||||
session passed in is inactive, otherwise it just calls the function
|
||||
directly. This is useful to avoid retrying things inside of a transaction
|
||||
which is ineffective for DB races/errors.
|
||||
|
||||
This should be used in all cases where retries are desired and the method
|
||||
accepts a context.
|
||||
"""
|
||||
def decorator(f):
|
||||
try:
|
||||
# NOTE(kevinbenton): we use pecan's util function here because it
|
||||
# deals with the horrors of finding args of already decorated
|
||||
# functions
|
||||
ctx_arg_index = p_util.getargspec(f).args.index(context_var_name)
|
||||
except ValueError:
|
||||
raise RuntimeError(_LE("Could not find position of var %s")
|
||||
% context_var_name)
|
||||
f_with_retry = db_api.retry_db_errors(f)
|
||||
|
||||
@six.wraps(f)
|
||||
def wrapped(*args, **kwargs):
|
||||
# only use retry wrapper if we aren't nested in an active
|
||||
# transaction
|
||||
if context_var_name in kwargs:
|
||||
context = kwargs[context_var_name]
|
||||
else:
|
||||
context = args[ctx_arg_index]
|
||||
method = f if context.session.is_active else f_with_retry
|
||||
return method(*args, **kwargs)
|
||||
return wrapped
|
||||
return decorator
|
||||
|
||||
|
||||
class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
||||
|
||||
"""Implementation of the Group Policy Model Plugin.
|
||||
|
@ -464,7 +503,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
{'port_attributes': port_attributes})
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_policy_target(self, context, policy_target):
|
||||
self._ensure_tenant(context, policy_target['policy_target'])
|
||||
self._add_fixed_ips_to_port_attributes(policy_target)
|
||||
|
@ -494,7 +533,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_target(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_policy_target(self, context, policy_target_id, policy_target):
|
||||
self._add_fixed_ips_to_port_attributes(policy_target)
|
||||
session = context.session
|
||||
|
@ -520,7 +559,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_target(context, policy_target_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_policy_target(self, context, policy_target_id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -541,13 +580,13 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
policy_target_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_target(self, context, policy_target_id, fields=None):
|
||||
return self._get_resource(context, 'policy_target', policy_target_id,
|
||||
'PolicyTargetContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_targets(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -557,7 +596,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_policy_target_group(self, context, policy_target_group):
|
||||
self._ensure_tenant(context,
|
||||
policy_target_group['policy_target_group'])
|
||||
|
@ -588,7 +627,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_target_group(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_policy_target_group(self, context, policy_target_group_id,
|
||||
policy_target_group):
|
||||
session = context.session
|
||||
|
@ -628,7 +667,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_target_group(context, policy_target_group_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_policy_target_group(self, context, policy_target_group_id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -684,7 +723,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
policy_target_group_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_target_group(self, context, policy_target_group_id,
|
||||
fields=None):
|
||||
return self._get_resource(context, 'policy_target_group',
|
||||
|
@ -692,7 +731,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
'PolicyTargetGroupContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_target_groups(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -702,7 +741,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_application_policy_group(self, context,
|
||||
application_policy_group):
|
||||
self._ensure_tenant(
|
||||
|
@ -733,7 +772,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_application_policy_group(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_application_policy_group(self, context,
|
||||
application_policy_group_id,
|
||||
application_policy_group):
|
||||
|
@ -766,7 +805,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
application_policy_group_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_application_policy_group(self, context,
|
||||
application_policy_group_id):
|
||||
session = context.session
|
||||
|
@ -789,7 +828,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
application_policy_group_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_application_policy_group(self, context,
|
||||
application_policy_group_id, fields=None):
|
||||
return self._get_resource(context, 'application_policy_group',
|
||||
|
@ -798,7 +837,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_application_policy_groups(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -808,7 +847,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
sorts=sorts, limit=limit, marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_l2_policy(self, context, l2_policy):
|
||||
self._ensure_tenant(context, l2_policy['l2_policy'])
|
||||
session = context.session
|
||||
|
@ -835,7 +874,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_l2_policy(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_l2_policy(self, context, l2_policy_id, l2_policy):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -859,7 +898,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_l2_policy(context, l2_policy_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_l2_policy(self, context, l2_policy_id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -879,14 +918,14 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
"for l2_policy %s"), l2_policy_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_l2_policy(self, context, l2_policy_id, fields=None):
|
||||
return self._get_resource(context, 'l2_policy',
|
||||
l2_policy_id,
|
||||
'L2PolicyContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_l2_policies(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -896,7 +935,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_network_service_policy(self, context, network_service_policy):
|
||||
self._ensure_tenant(
|
||||
context, network_service_policy['network_service_policy'])
|
||||
|
@ -929,7 +968,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_network_service_policy(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_network_service_policy(self, context, network_service_policy_id,
|
||||
network_service_policy):
|
||||
session = context.session
|
||||
|
@ -959,7 +998,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
network_service_policy_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_network_service_policy(
|
||||
self, context, network_service_policy_id):
|
||||
session = context.session
|
||||
|
@ -982,7 +1021,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
"for network_service_policy %s"), network_service_policy_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_network_service_policy(self, context, network_service_policy_id,
|
||||
fields=None):
|
||||
return self._get_resource(context, 'network_service_policy',
|
||||
|
@ -990,7 +1029,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
'NetworkServicePolicyContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_network_service_policies(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -1000,7 +1039,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_l3_policy(self, context, l3_policy):
|
||||
self._ensure_tenant(context, l3_policy['l3_policy'])
|
||||
session = context.session
|
||||
|
@ -1029,7 +1068,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_l3_policy(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_l3_policy(self, context, l3_policy_id, l3_policy):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1054,7 +1093,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_l3_policy(context, l3_policy_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_l3_policy(self, context, l3_policy_id, check_unused=False):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1079,14 +1118,14 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return True
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_l3_policy(self, context, l3_policy_id, fields=None):
|
||||
return self._get_resource(context, 'l3_policy',
|
||||
l3_policy_id,
|
||||
'L3PolicyContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_l3_policies(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -1096,7 +1135,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_policy_classifier(self, context, policy_classifier):
|
||||
self._ensure_tenant(context,
|
||||
policy_classifier['policy_classifier'])
|
||||
|
@ -1127,7 +1166,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_classifier(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_policy_classifier(self, context, id, policy_classifier):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1152,7 +1191,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_classifier(context, id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_policy_classifier(self, context, id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1172,7 +1211,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
"for policy_classifier %s"), id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_classifier(self, context, policy_classifier_id,
|
||||
fields=None):
|
||||
return self._get_resource(context, 'policy_classifier',
|
||||
|
@ -1180,7 +1219,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
'PolicyClassifierContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_classifiers(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -1190,7 +1229,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_policy_action(self, context, policy_action):
|
||||
self._ensure_tenant(context, policy_action['policy_action'])
|
||||
session = context.session
|
||||
|
@ -1220,7 +1259,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_action(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_policy_action(self, context, id, policy_action):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1246,7 +1285,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_action(context, id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_policy_action(self, context, id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1265,14 +1304,14 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
"for policy_action %s"), id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_action(self, context, policy_action_id, fields=None):
|
||||
return self._get_resource(context, 'policy_action',
|
||||
policy_action_id,
|
||||
'PolicyActionContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_actions(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -1282,7 +1321,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_policy_rule(self, context, policy_rule):
|
||||
self._ensure_tenant(context, policy_rule['policy_rule'])
|
||||
session = context.session
|
||||
|
@ -1311,7 +1350,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_rule(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_policy_rule(self, context, id, policy_rule):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1335,7 +1374,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_rule(context, id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_policy_rule(self, context, id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1355,14 +1394,14 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
"for policy_rule %s"), id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_rule(self, context, policy_rule_id, fields=None):
|
||||
return self._get_resource(context, 'policy_rule',
|
||||
policy_rule_id,
|
||||
'PolicyRuleContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_rules(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -1372,7 +1411,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_policy_rule_set(self, context, policy_rule_set):
|
||||
self._ensure_tenant(context, policy_rule_set['policy_rule_set'])
|
||||
session = context.session
|
||||
|
@ -1402,7 +1441,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_rule_set(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_policy_rule_set(self, context, id, policy_rule_set):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1427,7 +1466,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_policy_rule_set(context, id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_policy_rule_set(self, context, id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1446,14 +1485,14 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
"for policy_rule_set %s"), id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_rule_set(self, context, policy_rule_set_id, fields=None):
|
||||
return self._get_resource(context, 'policy_rule_set',
|
||||
policy_rule_set_id,
|
||||
'PolicyRuleSetContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_policy_rule_sets(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -1463,7 +1502,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_external_segment(self, context, external_segment):
|
||||
self._ensure_tenant(context, external_segment['external_segment'])
|
||||
session = context.session
|
||||
|
@ -1496,7 +1535,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_external_segment(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_external_segment(self, context, external_segment_id,
|
||||
external_segment):
|
||||
session = context.session
|
||||
|
@ -1527,7 +1566,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_external_segment(context, external_segment_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_external_segment(self, context, external_segment_id):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1551,14 +1590,14 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return True
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_external_segment(self, context, external_segment_id, fields=None):
|
||||
return self._get_resource(context, 'external_segment',
|
||||
external_segment_id,
|
||||
'ExternalSegmentContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_external_segments(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -1568,7 +1607,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_external_policy(self, context, external_policy):
|
||||
self._ensure_tenant(context, external_policy['external_policy'])
|
||||
session = context.session
|
||||
|
@ -1598,7 +1637,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_external_policy(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_external_policy(self, context, external_policy_id,
|
||||
external_policy):
|
||||
session = context.session
|
||||
|
@ -1626,7 +1665,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_external_policy(context, external_policy_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_external_policy(self, context, external_policy_id,
|
||||
check_unused=False):
|
||||
session = context.session
|
||||
|
@ -1647,14 +1686,14 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
"for external_policy %s"), external_policy_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_external_policy(self, context, external_policy_id, fields=None):
|
||||
return self._get_resource(context, 'external_policy',
|
||||
external_policy_id,
|
||||
'ExternalPolicyContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_external_policies(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
@ -1664,7 +1703,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
marker=marker, page_reverse=page_reverse)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def create_nat_pool(self, context, nat_pool):
|
||||
self._ensure_tenant(context, nat_pool['nat_pool'])
|
||||
session = context.session
|
||||
|
@ -1691,7 +1730,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_nat_pool(context, result['id'])
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def update_nat_pool(self, context, nat_pool_id, nat_pool):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1713,7 +1752,7 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
return self.get_nat_pool(context, nat_pool_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def delete_nat_pool(self, context, nat_pool_id, check_unused=False):
|
||||
session = context.session
|
||||
with session.begin(subtransactions=True):
|
||||
|
@ -1733,14 +1772,14 @@ class GroupPolicyPlugin(group_policy_mapping_db.GroupPolicyMappingDbPlugin):
|
|||
nat_pool_id)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_nat_pool(self, context, nat_pool_id, fields=None):
|
||||
return self._get_resource(context, 'nat_pool',
|
||||
nat_pool_id,
|
||||
'NatPoolContext', fields=fields)
|
||||
|
||||
@log.log_method_call
|
||||
@db_api.retry_db_errors
|
||||
@retry_if_session_inactive()
|
||||
def get_nat_pools(self, context, filters=None, fields=None,
|
||||
sorts=None, limit=None, marker=None,
|
||||
page_reverse=False):
|
||||
|
|
Loading…
Reference in New Issue