From 63fbeaa3bc4365eabc90a51dcbf7d98f4755bd20 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Tue, 12 Jun 2018 10:27:11 +0300 Subject: [PATCH] Fix LB drivers to have a core plugin The recent Octavia preparation caused the LB drivers not to have a core_plugin property which fails the on-router-action callbacks. This patch will address it. Change-Id: I6b2c98bd605ff33bf173911898267a8ed3f7045f --- vmware_nsx/services/lbaas/lb_helper.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vmware_nsx/services/lbaas/lb_helper.py b/vmware_nsx/services/lbaas/lb_helper.py index 8b9cb84201..169e235875 100644 --- a/vmware_nsx/services/lbaas/lb_helper.py +++ b/vmware_nsx/services/lbaas/lb_helper.py @@ -16,6 +16,8 @@ from oslo_log import helpers as log_helpers from neutron_lib import exceptions as n_exc +from neutron_lib.plugins import constants as plugin_const +from neutron_lib.plugins import directory class LBaaSNSXObjectManagerWrapper(object): @@ -24,6 +26,8 @@ class LBaaSNSXObjectManagerWrapper(object): This class will call the actual NSX-V LBaaS logic after translating the LB object into a dictionary, and will also handle success/failure cases """ + _core_plugin = None + @log_helpers.log_method_call def __init__(self, object_type, implementor, translator, get_completor): super(LBaaSNSXObjectManagerWrapper, self).__init__() @@ -32,6 +36,17 @@ class LBaaSNSXObjectManagerWrapper(object): self.translator = translator self.get_completor = get_completor + def _get_plugin(self, plugin_type): + return directory.get_plugin(plugin_type) + + @property + def core_plugin(self): + if not self._core_plugin: + self._core_plugin = ( + self._get_plugin(plugin_const.CORE)) + + return self._core_plugin + def get_completor_func(self, context, obj, delete=False): # return a method that will be called on success/failure completion def completor_func(success=True):