Some cleanup in L3 HA code
This patch addresses the following. 1. removes the un-used variables. 2. process_monitor (argument to KeepalivedManager) is changed to a non-default parameter as its used in spawn, disable methods. Change-Id: I8b130b21965ed3387e994818be947eb95d73a423
This commit is contained in:
parent
7da684cec8
commit
a1b8a770c1
@ -27,7 +27,6 @@ from neutron.notifiers import batch_notifier
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
HA_DEV_PREFIX = 'ha-'
|
|
||||||
KEEPALIVED_STATE_CHANGE_SERVER_BACKLOG = 4096
|
KEEPALIVED_STATE_CHANGE_SERVER_BACKLOG = 4096
|
||||||
|
|
||||||
OPTS = [
|
OPTS = [
|
||||||
|
@ -92,9 +92,9 @@ class HaRouter(router.RouterInfo):
|
|||||||
self.keepalived_manager = keepalived.KeepalivedManager(
|
self.keepalived_manager = keepalived.KeepalivedManager(
|
||||||
self.router['id'],
|
self.router['id'],
|
||||||
keepalived.KeepalivedConf(),
|
keepalived.KeepalivedConf(),
|
||||||
|
process_monitor,
|
||||||
conf_path=self.agent_conf.ha_confs_path,
|
conf_path=self.agent_conf.ha_confs_path,
|
||||||
namespace=self.ns_name,
|
namespace=self.ns_name)
|
||||||
process_monitor=process_monitor)
|
|
||||||
|
|
||||||
config = self.keepalived_manager.config
|
config = self.keepalived_manager.config
|
||||||
|
|
||||||
|
@ -290,14 +290,13 @@ class KeepalivedManager(object):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, resource_id, config, conf_path='/tmp',
|
def __init__(self, resource_id, config, process_monitor, conf_path='/tmp',
|
||||||
namespace=None, process_monitor=None):
|
namespace=None):
|
||||||
self.resource_id = resource_id
|
self.resource_id = resource_id
|
||||||
self.config = config
|
self.config = config
|
||||||
self.namespace = namespace
|
self.namespace = namespace
|
||||||
self.process_monitor = process_monitor
|
self.process_monitor = process_monitor
|
||||||
self.conf_path = conf_path
|
self.conf_path = conf_path
|
||||||
self.process = None
|
|
||||||
|
|
||||||
def get_conf_dir(self):
|
def get_conf_dir(self):
|
||||||
confs_dir = os.path.abspath(os.path.normpath(self.conf_path))
|
confs_dir = os.path.abspath(os.path.normpath(self.conf_path))
|
||||||
|
@ -33,8 +33,8 @@ class KeepalivedManagerTestCase(base.BaseTestCase,
|
|||||||
self.process_monitor = external_process.ProcessMonitor(cfg.CONF,
|
self.process_monitor = external_process.ProcessMonitor(cfg.CONF,
|
||||||
'router')
|
'router')
|
||||||
self.manager = keepalived.KeepalivedManager(
|
self.manager = keepalived.KeepalivedManager(
|
||||||
'router1', self.expected_config, conf_path=cfg.CONF.state_path,
|
'router1', self.expected_config, self.process_monitor,
|
||||||
process_monitor=self.process_monitor)
|
conf_path=cfg.CONF.state_path)
|
||||||
self.addCleanup(self.manager.get_process().disable)
|
self.addCleanup(self.manager.get_process().disable)
|
||||||
|
|
||||||
def test_keepalived_spawn(self):
|
def test_keepalived_spawn(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user