service: use restart_method='mutate' for all services

I8f09f9482736b496e3ad7117f170e476e92c2b7d changed the way SIGHUP is
handled by nova-api by telling oslo_service to reload config files
and run 'mutation' hooks for a set of supported options.

Make sure we use the very same mechanism for other service like
nova-compute, that do not use process_launcher() directly, but rely
on launch() helper from oslo_service instead.

Change-Id: Ie4e7c06814310f661d054d2181340418fd0df7bc
This commit is contained in:
Roman Podoliaka 2017-05-04 18:29:16 +03:00
parent d219a3dcdc
commit 8854a24c58
2 changed files with 6 additions and 3 deletions

View File

@ -427,7 +427,8 @@ def serve(server, workers=None):
if _launcher:
raise RuntimeError(_('serve() can only be called once'))
_launcher = service.launch(CONF, server, workers=workers)
_launcher = service.launch(CONF, server, workers=workers,
restart_method='mutate')
def wait():

View File

@ -340,7 +340,8 @@ class TestLauncher(test.NoDBTestCase):
service.serve(mock.sentinel.service)
mock_launch.assert_called_once_with(mock.ANY,
mock.sentinel.service,
workers=None)
workers=None,
restart_method='mutate')
@mock.patch.object(_service, 'launch')
def test_launch_app_with_workers(self, mock_launch):
@ -348,7 +349,8 @@ class TestLauncher(test.NoDBTestCase):
service.serve(mock.sentinel.service, workers=mock.sentinel.workers)
mock_launch.assert_called_once_with(mock.ANY,
mock.sentinel.service,
workers=mock.sentinel.workers)
workers=mock.sentinel.workers,
restart_method='mutate')
@mock.patch.object(_service, 'launch')
def test_launch_app_more_than_once_raises(self, mock_launch):