Browse Source

Enable mutable config in monasca_transform

New releases of oslo.config support a 'mutable' parameter to Opts.
oslo.service provides an option here Icec3e664f3fe72614e373b2938e8dee53cf8bc5e
allows services to tell oslo.service they want mutate_config_files to be
called by passing a parameter.

This commit is to use the same. This allows monasca_transform to benefit from
I1e7a69de169cc85f4c09954b2f46ce2da7106d90, where the 'debug' option
(owned by oslo.log) is made mutable. we should be able to turn debug
logging on and off by changing the config.

tc goal:
https://governance.openstack.org/tc/goals/rocky/enable-mutable-configuration.html

Change-Id: I86571df78014a810ffa881ceceeddfc5193c9ca5
sajuptpm 9 months ago
parent
commit
410115088e

+ 1
- 1
monasca_transform/service/transform_service.py View File

@@ -288,7 +288,7 @@ def main_service():
288 288
     """Method to use with Openstack service."""
289 289
     ConfigInitializer.basic_config()
290 290
     LogUtils.init_logger(__name__)
291
-    launcher = os_service.ServiceLauncher(cfg.CONF)
291
+    launcher = os_service.ServiceLauncher(cfg.CONF, restart_method='mutate')
292 292
     launcher.launch_service(Transform())
293 293
     launcher.wait()
294 294
 

+ 2
- 1
tests/unit/service/test_transform_service.py View File

@@ -53,7 +53,8 @@ class TransformServiceTestBase(unittest.TestCase):
53 53
                 launcher = oslo_service.service.launch(
54 54
                     self.conf,
55 55
                     transform_service.Transform(),
56
-                    workers=1)
56
+                    workers=1,
57
+                    restart_method='mutate')
57 58
                 status = launcher.wait()
58 59
             except SystemExit as exc:
59 60
                 traceback.print_exc()

Loading…
Cancel
Save