Merge "Enable mutable config in Murano"

This commit is contained in:
Zuul 2018-03-26 01:21:33 +00:00 committed by Gerrit Code Review
commit 20dfea796e
4 changed files with 18 additions and 9 deletions

View File

@ -63,7 +63,9 @@ def main():
workers = CONF.murano.api_workers
if not workers:
workers = processutils.get_worker_count()
launcher = service.launch(CONF, server.ApiService(), workers=workers)
launcher = service.launch(
CONF, server.ApiService(),
workers=workers, restart_method='mutate')
app = app_loader.load_paste_app('murano')
port, host = (CONF.bind_port, CONF.bind_host)

View File

@ -53,8 +53,9 @@ def main():
workers = CONF.engine.engine_workers
if not workers:
workers = processutils.get_worker_count()
launcher = service.launch(CONF,
engine.EngineService(), workers=workers)
launcher = service.launch(
CONF, engine.EngineService(),
workers=workers, restart_method='mutate')
launcher.wait()
except RuntimeError as e:
sys.stderr.write("ERROR: %s\n" % e)

View File

@ -39,7 +39,8 @@ class TestAPIWorkers(base.MuranoTestCase):
load_paste_app, set_middleware_defaults):
api.main()
launch.assert_called_once_with(mock.ANY, mock.ANY,
workers=processutils.get_worker_count())
workers=processutils.get_worker_count(),
restart_method='mutate')
@mock.patch.object(config, 'parse_args')
@mock.patch.object(logging, 'setup')
@ -51,7 +52,8 @@ class TestAPIWorkers(base.MuranoTestCase):
load_paste_app, set_middleware_defaults):
self.override_config("api_workers", 8, "murano")
api.main()
launch.assert_called_once_with(mock.ANY, mock.ANY, workers=8)
launch.assert_called_once_with(mock.ANY, mock.ANY, workers=8,
restart_method='mutate')
@mock.patch.object(config, 'parse_args')
@mock.patch.object(logging, 'setup')
@ -64,4 +66,5 @@ class TestAPIWorkers(base.MuranoTestCase):
self.override_config("api_workers", 0, "murano")
api.main()
launch.assert_called_once_with(mock.ANY, mock.ANY,
workers=processutils.get_worker_count())
workers=processutils.get_worker_count(),
restart_method='mutate')

View File

@ -30,7 +30,8 @@ class TestEngineWorkers(base.MuranoTestCase):
def test_workers_default(self, launch, setup, parse_args):
engine.main()
launch.assert_called_once_with(mock.ANY, mock.ANY,
workers=processutils.get_worker_count())
workers=processutils.get_worker_count(),
restart_method='mutate')
@mock.patch.object(config, 'parse_args')
@mock.patch.object(logging, 'setup')
@ -38,7 +39,8 @@ class TestEngineWorkers(base.MuranoTestCase):
def test_workers_good_setting(self, launch, setup, parse_args):
self.override_config("engine_workers", 8, "engine")
engine.main()
launch.assert_called_once_with(mock.ANY, mock.ANY, workers=8)
launch.assert_called_once_with(mock.ANY, mock.ANY, workers=8,
restart_method='mutate')
@mock.patch.object(config, 'parse_args')
@mock.patch.object(logging, 'setup')
@ -47,4 +49,5 @@ class TestEngineWorkers(base.MuranoTestCase):
self.override_config("engine_workers", 0, "engine")
engine.main()
launch.assert_called_once_with(mock.ANY, mock.ANY,
workers=processutils.get_worker_count())
workers=processutils.get_worker_count(),
restart_method='mutate')