Preparing for Pike support 2 (neutron_lib context)
Using the neutron context from neutron_lib (but continues using db_api from neutron instead of neutron_lib). Note that Neutron still uses the context from the Neutron repo in Ocata, so with this patch, both, Neutron and neutron_lib, contexts will be in play depending on whether the context is being instantiated by Neutron or by GBP. Also updating the tox hacking ignores to not require translation hints for log messages. This should have been removed in the previously merged patch which removed the log message hints. Change-Id: I8df4d00a8c0109e04e1f72576a54048332666078
This commit is contained in:
@@ -33,27 +33,11 @@ def get_extensions_path(service_plugins=None):
|
||||
extensions.get_extensions_path = get_extensions_path
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
from neutron import context as n_context
|
||||
|
||||
from gbpservice.network.neutronv2 import local_api
|
||||
from gbpservice.common import utils as gbp_utils
|
||||
|
||||
|
||||
def get_current_session():
|
||||
i = 1
|
||||
not_found = True
|
||||
try:
|
||||
while not_found:
|
||||
for val in sys._getframe(i).f_locals.itervalues():
|
||||
if isinstance(val, n_context.Context):
|
||||
ctx = val
|
||||
not_found = False
|
||||
break
|
||||
i = i + 1
|
||||
return ctx.session
|
||||
except Exception:
|
||||
return
|
||||
return gbp_utils.get_current_session()
|
||||
|
||||
|
||||
from neutron.plugins.ml2 import ovo_rpc
|
||||
@@ -69,6 +53,8 @@ ovo_rpc.LOG.error = ovo_rpc.LOG.debug
|
||||
|
||||
from neutron.callbacks import registry
|
||||
|
||||
from gbpservice.network.neutronv2 import local_api
|
||||
|
||||
|
||||
def notify(resource, event, trigger, **kwargs):
|
||||
if 'context' in kwargs:
|
||||
|
||||
Reference in New Issue
Block a user