Remove log_helper from lbaas methods
As their arguments are very big recursive dictionaries, this overloads the logs. Change-Id: I241999ba53c721fc4efbf428dfb1a181640d2e96
This commit is contained in:
parent
e7914520ba
commit
54ce120afb
@ -13,15 +13,18 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
|
||||
from vmware_nsx._i18n import _
|
||||
from vmware_nsx.services.lbaas import lb_const
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def validate_session_persistence(pool, listener, completor):
|
||||
sp = pool.get('session_persistence')
|
||||
LOG.debug("validate_session_persistence called with session_persistence "
|
||||
"%s", sp)
|
||||
if not listener or not sp:
|
||||
# safety first!
|
||||
return
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -49,7 +48,6 @@ class EdgeHealthMonitorManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
int(code) for code in codes]
|
||||
return body
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, hm, completor):
|
||||
pool_id = hm['pool']['id']
|
||||
pool_client = self.core_plugin.nsxpolicy.load_balancer.lb_pool
|
||||
@ -88,7 +86,6 @@ class EdgeHealthMonitorManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_hm, new_hm, completor):
|
||||
monitor_client = lb_utils.get_monitor_policy_client(
|
||||
self.core_plugin.nsxpolicy.load_balancer, new_hm)
|
||||
@ -103,7 +100,6 @@ class EdgeHealthMonitorManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, hm, completor):
|
||||
pool_id = hm['pool']['id']
|
||||
pool_client = self.core_plugin.nsxpolicy.load_balancer.lb_pool
|
||||
@ -137,6 +133,5 @@ class EdgeHealthMonitorManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, hm, completor):
|
||||
self.delete(context, hm, completor)
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -28,7 +27,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgeL7PolicyManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, policy, completor):
|
||||
vs_client = self.core_plugin.nsxpolicy.load_balancer.virtual_server
|
||||
policy_name = utils.get_name_and_uuid(policy['name'] or 'policy',
|
||||
@ -50,7 +48,6 @@ class EdgeL7PolicyManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_policy, new_policy, completor):
|
||||
vs_client = self.core_plugin.nsxpolicy.load_balancer.virtual_server
|
||||
policy_name = utils.get_name_and_uuid(old_policy['name'] or 'policy',
|
||||
@ -87,6 +84,5 @@ class EdgeL7PolicyManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
raise n_exc.BadRequest(resource='lbaas-l7policy', msg=msg)
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, policy, completor):
|
||||
self.delete(context, policy, completor)
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -25,7 +24,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgeL7RuleManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _update_l7rule_change(self, rule, completor, delete=False):
|
||||
vs_client = self.core_plugin.nsxpolicy.load_balancer.virtual_server
|
||||
policy = rule['policy']
|
||||
@ -50,19 +48,15 @@ class EdgeL7RuleManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, rule, completor):
|
||||
self._update_l7rule_change(rule, completor)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_rule, new_rule, completor):
|
||||
self._update_l7rule_change(new_rule, completor)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, rule, completor):
|
||||
self._update_l7rule_change(rule, completor, delete=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, rule, completor):
|
||||
# No action should be taken on rules delete cascade
|
||||
pass
|
||||
|
@ -16,7 +16,6 @@
|
||||
import functools
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
|
||||
from vmware_nsx._i18n import _
|
||||
@ -32,7 +31,6 @@ LOG = logging.getLogger(__name__)
|
||||
ADV_RULE_NAME = 'LB external VIP advertisement'
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def get_rule_match_conditions(policy):
|
||||
match_conditions = []
|
||||
# values in rule have already been validated in LBaaS API,
|
||||
@ -76,7 +74,6 @@ def get_rule_match_conditions(policy):
|
||||
return match_conditions
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def get_rule_actions(nsxpolicy, l7policy):
|
||||
if l7policy['action'] == lb_const.L7_POLICY_ACTION_REDIRECT_TO_POOL:
|
||||
if l7policy['redirect_pool_id']:
|
||||
@ -103,7 +100,6 @@ def get_rule_actions(nsxpolicy, l7policy):
|
||||
return actions
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def convert_l7policy_to_lb_rule(nsxpolicy, policy):
|
||||
return {
|
||||
'match_conditions': get_rule_match_conditions(policy),
|
||||
@ -113,19 +109,16 @@ def convert_l7policy_to_lb_rule(nsxpolicy, policy):
|
||||
}
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def remove_rule_from_policy(rule):
|
||||
l7rules = rule['policy']['rules']
|
||||
rule['policy']['rules'] = [r for r in l7rules if r['id'] != rule['id']]
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update_rule_in_policy(rule):
|
||||
remove_rule_from_policy(rule)
|
||||
rule['policy']['rules'].append(rule)
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update_router_lb_vip_advertisement(context, core_plugin, router_id):
|
||||
router = core_plugin.get_router(context.elevated(), router_id)
|
||||
|
||||
@ -143,7 +136,6 @@ def update_router_lb_vip_advertisement(context, core_plugin, router_id):
|
||||
external_cidrs)
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def get_monitor_policy_client(lb_client, hm):
|
||||
if hm['type'] == lb_const.LB_HEALTH_MONITOR_TCP:
|
||||
return lb_client.lb_monitor_profile_tcp
|
||||
|
@ -16,7 +16,6 @@
|
||||
import copy
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -35,7 +34,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgeListenerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _get_listener_tags(self, context, listener):
|
||||
tags = lb_utils.get_tags(self.core_plugin, listener['id'],
|
||||
lb_const.LB_LISTENER_TYPE,
|
||||
@ -49,7 +47,6 @@ class EdgeListenerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
'tag': listener['loadbalancer_id']})
|
||||
return tags
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _upload_certificate(self, listener_id, cert_href, tags,
|
||||
certificate=None):
|
||||
nsxpolicy = self.core_plugin.nsxpolicy
|
||||
@ -73,7 +70,6 @@ class EdgeListenerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
}
|
||||
}
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _get_virtual_server_kwargs(self, context, listener, vs_name, tags,
|
||||
certificate=None):
|
||||
# If loadbalancer vip_port already has floating ip, use floating
|
||||
@ -151,9 +147,7 @@ class EdgeListenerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
lb_common.validate_session_persistence(
|
||||
listener.get('default_pool'), listener, completor)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, listener, completor,
|
||||
certificate=None):
|
||||
def create(self, context, listener, completor, certificate=None):
|
||||
nsxlib_lb = self.core_plugin.nsxpolicy.load_balancer
|
||||
vs_client = nsxlib_lb.virtual_server
|
||||
vs_name = utils.get_name_and_uuid(listener['name'] or 'listener',
|
||||
@ -227,7 +221,6 @@ class EdgeListenerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
"virtual server %s",
|
||||
persistence_profile_id, listener['id'])
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_listener, new_listener, completor,
|
||||
certificate=None):
|
||||
nsxlib_lb = self.core_plugin.nsxpolicy.load_balancer
|
||||
@ -266,7 +259,6 @@ class EdgeListenerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
completor, old_listener)
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, listener, completor):
|
||||
nsxlib_lb = self.core_plugin.nsxpolicy.load_balancer
|
||||
vs_client = nsxlib_lb.virtual_server
|
||||
@ -320,7 +312,6 @@ class EdgeListenerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, listener, completor):
|
||||
self.delete(context, listener, completor)
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -33,14 +32,12 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
class EdgeLoadBalancerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _get_lb_router(self, context, lb):
|
||||
router_id = lb_utils.get_router_from_network(
|
||||
context, self.core_plugin, lb['vip_subnet_id'])
|
||||
|
||||
return router_id
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _get_info_from_fip(self, context, fip):
|
||||
filters = {'floating_ip_address': [fip]}
|
||||
floating_ips = self.core_plugin.get_floatingips(context,
|
||||
@ -53,7 +50,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
'be a floating IP') % {'fip': fip})
|
||||
raise n_exc.BadRequest(resource='lbaas-vip', msg=msg)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, lb, completor):
|
||||
lb_id = lb['id']
|
||||
|
||||
@ -125,11 +121,9 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
'device_owner': lb_const.VMWARE_LB_VIP_OWNER}})
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_lb, new_lb, completor):
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, lb, completor):
|
||||
router_id = lb_utils.get_router_from_network(
|
||||
context, self.core_plugin, lb['vip_subnet_id'])
|
||||
@ -177,23 +171,19 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, lb, completor):
|
||||
"""Delete all backend and DB resources of this loadbalancer"""
|
||||
self.delete(context, lb, completor)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def refresh(self, context, lb):
|
||||
# TODO(kobis): implement
|
||||
pass
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _get_lb_virtual_servers(self, context, lb):
|
||||
# Get all virtual servers that belong to this loadbalancer
|
||||
vs_list = [vs['id'] for vs in lb['listeners']]
|
||||
return vs_list
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def stats(self, context, lb):
|
||||
# Since multiple LBaaS loadbalancer can share the same LB service,
|
||||
# get the corresponding virtual servers' stats instead of LB service.
|
||||
@ -224,7 +214,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
raise n_exc.BadRequest(resource='lbaas-lb', msg=msg)
|
||||
return stats
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def get_operating_status(self, context, id, with_members=False):
|
||||
service_client = self.core_plugin.nsxpolicy.load_balancer.lb_service
|
||||
try:
|
||||
@ -262,7 +251,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
# to add the listeners statuses from the virtual servers statuses
|
||||
return statuses
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _nsx_status_to_lb_status(self, nsx_status):
|
||||
if not nsx_status:
|
||||
# default fallback
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -32,7 +31,6 @@ def _translate_member_state(state):
|
||||
|
||||
|
||||
class EdgeMemberManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _get_info_from_fip(self, context, fip):
|
||||
filters = {'floating_ip_address': [fip]}
|
||||
floating_ips = self.core_plugin.get_floatingips(context,
|
||||
@ -102,7 +100,6 @@ class EdgeMemberManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
'sub': member['subnet_id'],
|
||||
'err': e})
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, member, completor):
|
||||
pool_client = self.core_plugin.nsxpolicy.load_balancer.lb_pool
|
||||
self._validate_member_lb_connectivity(context, member, completor)
|
||||
@ -130,7 +127,6 @@ class EdgeMemberManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
'pool': pool_id, 'err': e})
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_member, new_member, completor):
|
||||
network = lb_utils.get_network_from_subnet(
|
||||
context, self.core_plugin, new_member['subnet_id'])
|
||||
@ -158,7 +154,6 @@ class EdgeMemberManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
'pool': pool_id, 'err': e})
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, member, completor):
|
||||
network = lb_utils.get_network_from_subnet(
|
||||
context, self.core_plugin, member['subnet_id'])
|
||||
@ -180,7 +175,6 @@ class EdgeMemberManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
'pool': pool_id, 'err': e})
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, member, completor):
|
||||
# No action should be taken on members delete cascade
|
||||
pass
|
||||
|
@ -16,7 +16,6 @@
|
||||
import functools
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -98,7 +97,6 @@ class EdgePoolManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
LOG.error('Failed to attach pool %s to virtual '
|
||||
'server %s', pool['id'], listener['id'])
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, pool, completor):
|
||||
pool_client = self.core_plugin.nsxpolicy.load_balancer.lb_pool
|
||||
|
||||
@ -144,7 +142,6 @@ class EdgePoolManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
listener, completor)
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_pool, new_pool, completor):
|
||||
pool_client = self.core_plugin.nsxpolicy.load_balancer.lb_pool
|
||||
|
||||
@ -194,7 +191,6 @@ class EdgePoolManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
'error %(error)s',
|
||||
{'pool': old_pool['id'], 'error': e})
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, pool, completor):
|
||||
pool_client = self.core_plugin.nsxpolicy.load_balancer.lb_pool
|
||||
|
||||
@ -243,6 +239,5 @@ class EdgePoolManagerFromDict(base_mgr.NsxpLoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, pool, completor):
|
||||
self.delete(context, pool, completor)
|
||||
|
@ -30,7 +30,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgeHealthMonitorManagerFromDict(base_mgr.EdgeLoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _convert_lbaas_monitor(self, hm):
|
||||
"""
|
||||
Transform OpenStack health monitor dict to NSXv health monitor dict.
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -31,7 +30,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgeHealthMonitorManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _build_monitor_args(self, hm):
|
||||
if hm['type'] in lb_const.NSXV3_MONITOR_MAP:
|
||||
monitor_type = lb_const.NSXV3_MONITOR_MAP.get(hm['type'])
|
||||
@ -61,7 +59,6 @@ class EdgeHealthMonitorManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
"not support it")
|
||||
return body
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, hm, completor):
|
||||
lb_id = hm['pool']['loadbalancer_id']
|
||||
pool_id = hm['pool']['id']
|
||||
@ -107,7 +104,6 @@ class EdgeHealthMonitorManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_hm, new_hm, completor):
|
||||
lb_id = new_hm['pool']['loadbalancer_id']
|
||||
pool_id = new_hm['pool']['id']
|
||||
@ -130,7 +126,6 @@ class EdgeHealthMonitorManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, hm, completor):
|
||||
lb_id = hm['pool']['loadbalancer_id']
|
||||
pool_id = hm['pool']['id']
|
||||
@ -175,6 +170,5 @@ class EdgeHealthMonitorManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, hm, completor):
|
||||
self.delete(context, hm, completor)
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -29,7 +28,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgeL7PolicyManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _update_policy_position(self, vs_id, rule_id, position):
|
||||
vs_client = self.core_plugin.nsxlib.load_balancer.virtual_server
|
||||
vs = vs_client.get(vs_id)
|
||||
@ -42,7 +40,6 @@ class EdgeL7PolicyManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
lb_rules.insert(position - 1, rule_id)
|
||||
vs_client.update(vs_id, rule_ids=lb_rules)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, policy, completor):
|
||||
lb_id = policy['listener']['loadbalancer_id']
|
||||
listener_id = policy['listener_id']
|
||||
@ -81,7 +78,6 @@ class EdgeL7PolicyManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
context.session, policy['id'], lb_rule['id'], vs_id)
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_policy, new_policy, completor):
|
||||
rule_client = self.core_plugin.nsxlib.load_balancer.rule
|
||||
binding = nsx_db.get_nsx_lbaas_l7policy_binding(context.session,
|
||||
@ -109,7 +105,6 @@ class EdgeL7PolicyManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, policy, completor):
|
||||
vs_client = self.core_plugin.nsxlib.load_balancer.virtual_server
|
||||
rule_client = self.core_plugin.nsxlib.load_balancer.rule
|
||||
@ -136,6 +131,5 @@ class EdgeL7PolicyManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, policy, completor):
|
||||
self.delete(context, policy, completor)
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -27,7 +26,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgeL7RuleManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _update_l7rule_change(self, context, rule, completor,
|
||||
delete=False):
|
||||
rule_client = self.core_plugin.nsxlib.load_balancer.rule
|
||||
@ -57,19 +55,15 @@ class EdgeL7RuleManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, rule, completor):
|
||||
self._update_l7rule_change(context, rule, completor)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_rule, new_rule, completor):
|
||||
self._update_l7rule_change(context, new_rule, completor)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, rule, completor):
|
||||
self._update_l7rule_change(context, rule, completor, delete=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, rulle, completor):
|
||||
# No action should be taken on rules delete cascade
|
||||
pass
|
||||
|
@ -137,7 +137,6 @@ def validate_lb_member_subnet(context, plugin, subnet_id, lb):
|
||||
return False
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def get_rule_match_conditions(policy):
|
||||
match_conditions = []
|
||||
# values in rule have already been validated in LBaaS API,
|
||||
@ -181,7 +180,6 @@ def get_rule_match_conditions(policy):
|
||||
return match_conditions
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def get_rule_actions(context, l7policy):
|
||||
lb_id = l7policy['listener']['loadbalancer_id']
|
||||
if l7policy['action'] == lb_const.L7_POLICY_ACTION_REDIRECT_TO_POOL:
|
||||
@ -210,7 +208,6 @@ def get_rule_actions(context, l7policy):
|
||||
return actions
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def convert_l7policy_to_lb_rule(context, policy):
|
||||
return {
|
||||
'match_conditions': get_rule_match_conditions(policy),
|
||||
@ -220,13 +217,11 @@ def convert_l7policy_to_lb_rule(context, policy):
|
||||
}
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def remove_rule_from_policy(rule):
|
||||
l7rules = rule['policy']['rules']
|
||||
rule['policy']['rules'] = [r for r in l7rules if r['id'] != rule['id']]
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update_rule_in_policy(rule):
|
||||
remove_rule_from_policy(rule)
|
||||
rule['policy']['rules'].append(rule)
|
||||
@ -256,7 +251,6 @@ def delete_persistence_profile(nsxlib, persistence_profile_id):
|
||||
nsxlib.load_balancer.persistence_profile.delete(persistence_profile_id)
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def build_persistence_profile_tags(pool_tags, listener):
|
||||
tags = pool_tags[:]
|
||||
# With octavia loadbalancer name might not be among data passed
|
||||
@ -281,7 +275,6 @@ def get_pool_tags(context, core_plugin, pool):
|
||||
context.project_name)
|
||||
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def setup_session_persistence(nsxlib, pool, pool_tags,
|
||||
switch_type, listener, vs_data):
|
||||
sp = pool.get('session_persistence')
|
||||
|
@ -16,7 +16,6 @@
|
||||
import copy
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -34,7 +33,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _get_virtual_server_kwargs(self, context, listener, vs_name, tags,
|
||||
app_profile_id, certificate=None):
|
||||
# If loadbalancer vip_port already has floating ip, use floating
|
||||
@ -72,7 +70,6 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
kwargs.update(ssl_profile_binding)
|
||||
return kwargs
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _get_ssl_profile_binding(self, tags, certificate=None):
|
||||
tm_client = self.core_plugin.nsxlib.trust_management
|
||||
if certificate:
|
||||
@ -96,7 +93,6 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
}
|
||||
}
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _get_listener_tags(self, context, listener):
|
||||
tags = lb_utils.get_tags(self.core_plugin, listener['id'],
|
||||
lb_const.LB_LISTENER_TYPE,
|
||||
@ -187,7 +183,6 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
nsx_db.update_nsx_lbaas_pool_binding(
|
||||
context.session, lb_id, pool_id, None)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, listener, completor,
|
||||
certificate=None):
|
||||
lb_id = listener['loadbalancer_id']
|
||||
@ -252,7 +247,6 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
context, listener, virtual_server, completor)
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_listener, new_listener, completor,
|
||||
certificate=None):
|
||||
nsxlib_lb = self.core_plugin.nsxlib.load_balancer
|
||||
@ -305,7 +299,6 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, listener, completor):
|
||||
lb_id = listener['loadbalancer_id']
|
||||
nsxlib_lb = self.core_plugin.nsxlib.load_balancer
|
||||
@ -393,7 +386,6 @@ class EdgeListenerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, listener, completor):
|
||||
self.delete(context, listener, completor)
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -34,7 +33,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, lb, completor):
|
||||
if not lb_utils.validate_lb_subnet(context, self.core_plugin,
|
||||
lb['vip_subnet_id']):
|
||||
@ -91,7 +89,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _create_lb_service(self, context, service_client, tenant_id,
|
||||
router_id, nsx_router_id, lb_id, lb_size):
|
||||
"""Create NSX LB service for a specific neutron router"""
|
||||
@ -128,7 +125,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
return lb_service
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _create_lb_service_without_router(self, context, service_client,
|
||||
tenant_id, lb, lb_size):
|
||||
"""Create NSX LB service for an external VIP
|
||||
@ -151,7 +147,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
return lb_service
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_lb, new_lb, completor):
|
||||
vs_client = self.core_plugin.nsxlib.load_balancer.virtual_server
|
||||
app_client = self.core_plugin.nsxlib.load_balancer.application_profile
|
||||
@ -185,7 +180,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, lb, completor):
|
||||
service_client = self.core_plugin.nsxlib.load_balancer.service
|
||||
router_client = self.core_plugin.nsxlib.logical_router
|
||||
@ -238,17 +232,14 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, lb, completor):
|
||||
"""Delete all backend and DB resources of this loadbalancer"""
|
||||
self.delete(context, lb, completor)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def refresh(self, context, lb):
|
||||
# TODO(tongl): implement
|
||||
pass
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _nsx_status_to_lb_status(self, nsx_status):
|
||||
if not nsx_status:
|
||||
# default fallback
|
||||
@ -268,7 +259,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
LOG.debug("NSX LB status %s - interpreted as ONLINE", nsx_status)
|
||||
return lb_const.ONLINE
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def get_lb_pool_members_statuses(self, nsx_pool_id, members_statuses):
|
||||
# Combine the NSX pool members data and the NSX statuses to provide
|
||||
# member statuses list
|
||||
@ -299,7 +289,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
statuses.append({'id': member_id, 'status': member_status})
|
||||
return statuses
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def get_operating_status(self, context, id, with_members=False):
|
||||
"""Return a map of the operating status of all connected LB objects """
|
||||
service_client = self.core_plugin.nsxlib.load_balancer.service
|
||||
@ -362,7 +351,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
return statuses
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def stats(self, context, lb):
|
||||
# Since multiple LBaaS loadbalancer can share the same LB service,
|
||||
# get the corresponding virtual servers' stats instead of LB service.
|
||||
@ -396,7 +384,6 @@ class EdgeLoadBalancerManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
raise n_exc.BadRequest(resource='lbaas-lb', msg=msg)
|
||||
return stats
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _get_lb_virtual_servers(self, context, lb):
|
||||
# Get all virtual servers that belong to this loadbalancer
|
||||
vs_list = []
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -31,7 +30,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgeMemberManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _get_info_from_fip(self, context, fip):
|
||||
filters = {'floating_ip_address': [fip]}
|
||||
floating_ips = self.core_plugin.get_floatingips(context,
|
||||
@ -44,7 +42,6 @@ class EdgeMemberManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
'be a floating IP') % {'fip': fip})
|
||||
raise n_exc.BadRequest(resource='lbaas-vip', msg=msg)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _get_updated_pool_members(self, context, lb_pool, member):
|
||||
network = lb_utils.get_network_from_subnet(
|
||||
context, self.core_plugin, member['subnet_id'])
|
||||
@ -60,13 +57,11 @@ class EdgeMemberManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
m['backup_member'] = member.get('backup', False)
|
||||
return lb_pool['members']
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, member, completor):
|
||||
with locking.LockManager.get_lock(
|
||||
'member-%s' % str(member['pool']['loadbalancer_id'])):
|
||||
self._member_create(context, member, completor)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _member_create(self, context, member, completor):
|
||||
lb_id = member['pool']['loadbalancer_id']
|
||||
pool_id = member['pool']['id']
|
||||
@ -167,7 +162,6 @@ class EdgeMemberManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_member, new_member, completor):
|
||||
lb_id = old_member['pool']['loadbalancer_id']
|
||||
pool_id = old_member['pool']['id']
|
||||
@ -192,7 +186,6 @@ class EdgeMemberManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
{'member': old_member['id'], 'err': e})
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, member, completor):
|
||||
lb_id = member['pool']['loadbalancer_id']
|
||||
pool_id = member['pool']['id']
|
||||
@ -227,7 +220,6 @@ class EdgeMemberManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, member, completor):
|
||||
# No action should be taken on members delete cascade
|
||||
pass
|
||||
|
@ -16,7 +16,6 @@
|
||||
import functools
|
||||
|
||||
from neutron_lib import exceptions as n_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -34,7 +33,6 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class EdgePoolManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
@log_helpers.log_method_call
|
||||
def _get_pool_kwargs(self, name=None, tags=None, algorithm=None,
|
||||
description=None):
|
||||
kwargs = {}
|
||||
@ -93,11 +91,9 @@ class EdgePoolManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
LOG.error('Failed to attach pool %s to virtual '
|
||||
'server %s', nsx_pool_id, nsx_vs_id)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def _get_pool_tags(self, context, pool):
|
||||
return lb_utils.get_pool_tags(context, self.core_plugin, pool)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def create(self, context, pool, completor):
|
||||
lb_id = pool['loadbalancer_id']
|
||||
pool_client = self.core_plugin.nsxlib.load_balancer.pool
|
||||
@ -157,7 +153,6 @@ class EdgePoolManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
raise nsx_exc.NsxPluginException(err_msg=msg)
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def update(self, context, old_pool, new_pool, completor):
|
||||
pool_client = self.core_plugin.nsxlib.load_balancer.pool
|
||||
pool_name = None
|
||||
@ -217,7 +212,6 @@ class EdgePoolManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
'error %(error)s',
|
||||
{'pool': old_pool['id'], 'error': e})
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete(self, context, pool, completor):
|
||||
lb_id = pool['loadbalancer_id']
|
||||
pool_client = self.core_plugin.nsxlib.load_balancer.pool
|
||||
@ -276,6 +270,5 @@ class EdgePoolManagerFromDict(base_mgr.Nsxv3LoadbalancerBaseManager):
|
||||
|
||||
completor(success=True)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
def delete_cascade(self, context, pool, completor):
|
||||
self.delete(context, pool, completor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user