diff --git a/neutron/common/ovn/utils.py b/neutron/common/ovn/utils.py index 9313a6a8f6e..f862e63d673 100644 --- a/neutron/common/ovn/utils.py +++ b/neutron/common/ovn/utils.py @@ -706,10 +706,12 @@ def get_port_subnet_ids(port): return [f['subnet_id'] for f in fixed_ips] -def get_method_class(method): - if not inspect.ismethod(method): +def get_method_class(method_or_class): + if not inspect.ismethod(method_or_class): + if inspect.isclass(method_or_class): + return method_or_class return - return method.__self__.__class__ + return method_or_class.__self__.__class__ def ovn_metadata_name(id_): diff --git a/neutron/server/api_eventlet.py b/neutron/server/api_eventlet.py index 194514aad19..d7eaa667aa1 100644 --- a/neutron/server/api_eventlet.py +++ b/neutron/server/api_eventlet.py @@ -14,12 +14,21 @@ # License for the specific language governing permissions and limitations # under the License. +from neutron_lib.callbacks import events +from neutron_lib.callbacks import registry +from neutron_lib.callbacks import resources from oslo_config import cfg +from neutron.api import wsgi from neutron.common import config from neutron.common import profiler def eventlet_api_server(): profiler.setup('neutron-server', cfg.CONF.host) - return config.load_paste_app('neutron') + app = config.load_paste_app('neutron') + registry.publish(resources.PROCESS, events.BEFORE_SPAWN, + wsgi.WorkerService) + registry.publish(resources.PROCESS, events.AFTER_INIT, + wsgi.WorkerService) + return app