Merge "Skip check config changed while restart_check_config not enable"

This commit is contained in:
Zuul 2019-10-15 03:17:44 +00:00 committed by Gerrit Code Review
commit 76356f950d
2 changed files with 3 additions and 7 deletions

View File

@ -559,12 +559,8 @@ class OpenSwanProcess(BaseSwanProcess):
def restart(self):
"""Restart the process."""
should_be_restart = False
if self._config_changed() or not cfg.CONF.pluto.restart_check_config:
should_be_restart = True
if not should_be_restart:
if cfg.CONF.pluto.restart_check_config and not self._config_changed():
return
# stop() followed immediately by a start() runs the risk that the
# current pluto daemon has not had a chance to shutdown. We check
# the current process information to see if the daemon is still

View File

@ -120,8 +120,8 @@ class TestOpenSwanDeviceDriver(test_scenario.TestIPSecBase):
self.sync_to_create_ipsec_connections(site1, site2)
# when restart_check_config is not set, start will be
# called in each sync
self.assertEqual(2, my_start.call_count)
# called in first sync
self.assertEqual(1, my_start.call_count)
my_start.reset_mock()
cfg.CONF.set_override('restart_check_config', True, group='pluto')