From 3b6f139b066fa61df852f480be3a583479c78eb6 Mon Sep 17 00:00:00 2001 From: Zhou Ya Date: Thu, 9 Feb 2017 16:19:19 +0800 Subject: Baremetal Deployment on zte-pod2 JIRA: DAISY-30 Change-Id: Ie34180b9d036797d310f612caa189b0a06efb732 Signed-off-by: Zhou Ya --- deploy/get_para_from_deploy.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) mode change 100755 => 100644 deploy/get_para_from_deploy.py (limited to 'deploy/get_para_from_deploy.py') diff --git a/deploy/get_para_from_deploy.py b/deploy/get_para_from_deploy.py old mode 100755 new mode 100644 index d142af3a..c75ba07b --- a/deploy/get_para_from_deploy.py +++ b/deploy/get_para_from_deploy.py @@ -32,19 +32,26 @@ def get_yml_para(dha_file): daisy_passwd = data.get("daisy_passwd", "") daisy_ip = data.get("daisy_ip", "") daisy_gateway = data.get("daisy_gateway", "") + daisy_target_node = data.get("hosts", "") + hosts_num = len(daisy_target_node) return daisyserver_size, controller_node_size,\ - compute_node_size, daisy_passwd, daisy_ip, daisy_gateway + compute_node_size, daisy_passwd, daisy_ip, daisy_gateway,\ + hosts_num def get_conf_from_deploy(): conf = cfg.ConfigOpts() parse(conf, sys.argv[1:]) daisyserver_size, controller_node_size, compute_node_size,\ - daisy_passwd, daisy_ip, daisy_gateway = get_yml_para(conf['dha']) - print "{ip} {passwd} -s {size} -g {gateway}".format(passwd=daisy_passwd, - size=daisyserver_size, - ip=daisy_ip, - gateway=daisy_gateway) + daisy_passwd, daisy_ip, daisy_gateway,\ + hosts_num = get_yml_para(conf['dha']) + print "{hosts_num} {ip} {passwd} -s {size} -g {gateway}".format( + hosts_num=hosts_num, + passwd=daisy_passwd, + size=daisyserver_size, + ip=daisy_ip, + gateway=daisy_gateway) + if __name__ == "__main__": get_conf_from_deploy() -- cgit 1.2.3-korg