Merge "Add a callback registry event for the init process - before spawning"

This commit is contained in:
Jenkins 2016-08-18 03:38:34 +00:00 committed by Gerrit Code Review
commit 96d053a389
2 changed files with 6 additions and 1 deletions

View File

@ -31,7 +31,8 @@ AFTER_REQUEST = 'after_request'
# String literals representing events associated to process operations # String literals representing events associated to process operations
BEFORE_INIT = 'before_init' BEFORE_INIT = 'before_init'
AFTER_INIT = 'after_init' BEFORE_SPAWN = 'before_spawn' # sent per process
AFTER_INIT = 'after_init' # sent per worker
# String literals representing events associated to error conditions # String literals representing events associated to error conditions
ABORT_CREATE = 'abort_create' ABORT_CREATE = 'abort_create'

View File

@ -27,6 +27,9 @@ from oslo_utils import excutils
from oslo_utils import importutils from oslo_utils import importutils
from neutron._i18n import _LE, _LI from neutron._i18n import _LE, _LI
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import config from neutron.common import config
from neutron.common import profiler from neutron.common import profiler
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc
@ -87,6 +90,7 @@ def serve_wsgi(cls):
LOG.exception(_LE('Unrecoverable error: please check log ' LOG.exception(_LE('Unrecoverable error: please check log '
'for details.')) 'for details.'))
registry.notify(resources.PROCESS, events.BEFORE_SPAWN, service)
return service return service