diff options
author | chigang <chigang@huawei.com> | 2017-07-26 17:19:30 +0800 |
---|---|---|
committer | chigang <chigang@huawei.com> | 2017-07-28 09:22:13 +0800 |
commit | 1edb67f913276eec2dad1adae80a3ac3d9a5356c (patch) | |
tree | dc3c6c7f68b3f5c22ad9a99973de84375899afc0 /deploy/client.py | |
parent | ef15f07cc10f92ba07fb22d257ccbde7fab9a51d (diff) |
Add moonv4 into Compass4nfv
JIRA:-
To deploy moon master, export MOON_CFG env like below compass deploy:
export MOON_CFG="master:flag=Disable,slave:flag=Enable,slave:name=slave1,slave:master_ip=master_ip"
To deploy moon slave, export MOON_CFG env like below compass deploy:
export MOON_CFG="master:flag=Enable,slave:flag=Disable,slave:name=slave1,slave:master_ip=master_ip"
Change-Id: I21c0186a029c508d390c69112b43510d9c5b9c5c
Signed-off-by: chigang <chigang@huawei.com>
Diffstat (limited to 'deploy/client.py')
-rw-r--r-- | deploy/client.py | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/deploy/client.py b/deploy/client.py index 366ae418..5eab212d 100644 --- a/deploy/client.py +++ b/deploy/client.py @@ -250,9 +250,9 @@ opts = [ cfg.StrOpt('odl_l3_agent', help='odl l3 agent enable flag', default='Disable'), - cfg.StrOpt('moon', - help='moon enable flag', - default='Disable'), + cfg.StrOpt('moon_cfg', + help='moon config', + default='master:flag=Disable,slave:flag=Disable,slave:name=slave1,slave:master_ip=master_ip'), # noqa cfg.StrOpt('onos_sfc', help='onos_sfc enable flag', default='Disable'), @@ -728,6 +728,30 @@ class CompassClient(object): 'password': password } + moon_cfgs = [ + cfg + for cfg in CONF.moon_cfg.split(',') + if cfg + ] + LOG.info( + 'moon configure: %s', moon_cfgs + ) + moon_cfg = {} + for cfg in moon_cfgs: + if ':' not in cfg: + raise Exception( + 'there is no : in cfg %s' % cfg # noqa + ) + role, conf_pair = cfg.split(':', 1) + if '=' not in conf_pair: + raise Exception( + 'there is no = in %s configure pair' % conf_pair + ) + key, value = conf_pair.split('=', 1) + moon_cfg[role] = {} if role not in moon_cfg else moon_cfg[role] + moon_cfg[role][key] = value + package_config["moon_cfg"] = moon_cfg + package_config["security"] = {"service_credentials": service_credential_cfg, # noqa "console_credentials": console_credential_cfg} # noqa @@ -761,12 +785,8 @@ class CompassClient(object): package_config['enable_secgroup'] = (CONF.enable_secgroup == "true") package_config['enable_fwaas'] = (CONF.enable_fwaas == "true") package_config['enable_vpnaas'] = (CONF.enable_vpnaas == "true") - package_config[ - 'odl_l3_agent'] = "Enable" if CONF.odl_l3_agent == "Enable" else "Disable" # noqa - package_config[ - 'moon'] = "Enable" if CONF.moon == "Enable" else "Disable" - package_config[ - 'onos_sfc'] = "Enable" if CONF.onos_sfc == "Enable" else "Disable" + package_config['odl_l3_agent'] = "Enable" if CONF.odl_l3_agent == "Enable" else "Disable" # noqa + package_config['onos_sfc'] = "Enable" if CONF.onos_sfc == "Enable" else "Disable" # noqa package_config['plugins'] = [] if CONF.plugins: for item in CONF.plugins.split(','): |