]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Modify the ProcessMonitor class to have one less config parameter
authorMiguel Angel Ajo <mangelajo@redhat.com>
Fri, 19 Sep 2014 16:59:58 +0000 (18:59 +0200)
committerMiguel Angel Ajo <mangelajo@redhat.com>
Tue, 7 Oct 2014 11:56:28 +0000 (13:56 +0200)
It's a follow up patch, as agreed on the ProcessMonitor review
patch to coalesce the check_child_processes parameter into
check_child_process_interval.

When this parameter is set to 0, the feature is disabled.

Change-Id: I2d4d8c6a6b7c17d42d8455c98968f75bcefbb689
Closes-Bug: 1371705

neutron/agent/linux/external_process.py
neutron/tests/functional/agent/linux/test_process_monitor.py

index b9d581210a59ceb68be0b9bdfb4875bfd127b6f2..ffea1247ac3c6df259ad3db80df04f0cb0c0c45a 100644 (file)
@@ -30,14 +30,12 @@ OPTS = [
     cfg.StrOpt('external_pids',
                default='$state_path/external/pids',
                help=_('Location to store child pid files')),
-    cfg.BoolOpt('check_child_processes', default=False,
-                help=_("Periodically check child processes")),
     cfg.StrOpt('check_child_processes_action', default='respawn',
                choices=['respawn', 'exit'],
                help=_('Action to be executed when a child process dies')),
-    cfg.IntOpt('check_child_processes_interval', default=60,
+    cfg.IntOpt('check_child_processes_interval', default=0,
                help=_('Interval between checks of child process liveness '
-                      '(seconds)')),
+                      '(seconds), use 0 to disable')),
 ]
 
 
@@ -156,7 +154,7 @@ class ProcessMonitor(object):
 
         self._process_managers = {}
 
-        if self._config.check_child_processes:
+        if self._config.check_child_processes_interval:
             self._spawn_checking_thread()
 
     def enable(self, uuid, cmd_callback, namespace=None, service=None,
index 8327a38b1ef52a5389fb8a36ca6dfb84d12bf869..4d3b69d279e149153ce484435d89ad49826f27dd 100644 (file)
@@ -29,7 +29,6 @@ class BaseTestProcessMonitor(base.BaseSudoTestCase):
     def setUp(self):
         super(BaseTestProcessMonitor, self).setUp()
         self._exit_handler_called = False
-        cfg.CONF.set_override('check_child_processes', True)
         cfg.CONF.set_override('check_child_processes_interval', 1)
         self._child_processes = []
         self._ext_processes = None