diff --git a/murano/cmd/api.py b/murano/cmd/api.py index 2ad1d234c..d9802aef4 100644 --- a/murano/cmd/api.py +++ b/murano/cmd/api.py @@ -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) diff --git a/murano/cmd/engine.py b/murano/cmd/engine.py index c524b5111..9318064f9 100644 --- a/murano/cmd/engine.py +++ b/murano/cmd/engine.py @@ -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) diff --git a/murano/tests/unit/cmd/test_api_workers.py b/murano/tests/unit/cmd/test_api_workers.py index 20fabc504..690d771df 100644 --- a/murano/tests/unit/cmd/test_api_workers.py +++ b/murano/tests/unit/cmd/test_api_workers.py @@ -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') diff --git a/murano/tests/unit/cmd/test_engine_workers.py b/murano/tests/unit/cmd/test_engine_workers.py index 2b3f95f34..6ef71582a 100644 --- a/murano/tests/unit/cmd/test_engine_workers.py +++ b/murano/tests/unit/cmd/test_engine_workers.py @@ -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')