Merge "Skip check config changed while restart_check_config not enable"
This commit is contained in:
commit
76356f950d
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue