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
This commit is contained in:
Adit Sarfaty 2018-06-12 10:27:11 +03:00
parent 2e6ed98749
commit 63fbeaa3bc

View File

@ -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):