From a0dc790ed95b7b3a6c5eba9bd0c19481a4e9490e Mon Sep 17 00:00:00 2001 From: Jeremy Liu Date: Fri, 23 Mar 2018 15:06:05 +0800 Subject: [PATCH] Enable mutable config in Barbican Task: 6360 Story: 2001545 Change-Id: Ib6b54effa52c4c6b4b30abf5eb7b54c453b1d008 --- barbican/cmd/keystone_listener.py | 3 ++- barbican/cmd/retry_scheduler.py | 3 ++- barbican/cmd/worker.py | 3 ++- barbican/tests/cmd/test_cmd.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/barbican/cmd/keystone_listener.py b/barbican/cmd/keystone_listener.py index 1570ee112..e739d34b3 100644 --- a/barbican/cmd/keystone_listener.py +++ b/barbican/cmd/keystone_listener.py @@ -73,7 +73,8 @@ def main(): if getattr(getattr(CONF, queue.KS_NOTIFICATIONS_GRP_NAME), 'enable'): service.launch( CONF, - keystone_listener.MessageServer(CONF) + keystone_listener.MessageServer(CONF), + restart_method='mutate' ).wait() else: LOG.info("Exiting as Barbican Keystone listener is not enabled...") diff --git a/barbican/cmd/retry_scheduler.py b/barbican/cmd/retry_scheduler.py index 8ec685458..fecf29eba 100644 --- a/barbican/cmd/retry_scheduler.py +++ b/barbican/cmd/retry_scheduler.py @@ -66,7 +66,8 @@ def main(): service.launch( CONF, - retry_scheduler.PeriodicServer() + retry_scheduler.PeriodicServer(), + restart_method='mutate' ).wait() except RuntimeError as e: fail(1, e) diff --git a/barbican/cmd/worker.py b/barbican/cmd/worker.py index 77ec256b8..9f4ed0564 100644 --- a/barbican/cmd/worker.py +++ b/barbican/cmd/worker.py @@ -67,7 +67,8 @@ def main(): service.launch( CONF, server.TaskServer(), - workers=CONF.queue.asynchronous_workers + workers=CONF.queue.asynchronous_workers, + restart_method='mutate' ).wait() except RuntimeError as e: fail(1, e) diff --git a/barbican/tests/cmd/test_cmd.py b/barbican/tests/cmd/test_cmd.py index e71dda6fa..6ae1729be 100644 --- a/barbican/tests/cmd/test_cmd.py +++ b/barbican/tests/cmd/test_cmd.py @@ -81,5 +81,5 @@ class WhenInvokingWorkerCommand(test_keystone_listener.UtilMixin, self.assertEqual(1, mock_queue_init.call_count) self.assertEqual(1, mock_service_launch.call_count) # check keyword argument for number of worker matches - workers_kwarg = {'workers': 3} + workers_kwarg = {'restart_method': 'mutate', 'workers': 3} self.assertEqual(workers_kwarg, mock_service_launch.call_args[1])