aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/config_parse.py
diff options
context:
space:
mode:
authorgrakiss <grakiss.wanglei@huawei.com>2016-03-17 02:39:36 -0400
committergrakiss <grakiss.wanglei@huawei.com>2016-03-17 02:41:11 -0400
commit2490b7463f3a2fc86277f957945b92263495c01c (patch)
tree160148cdef1291c8f1423c840e4a7a121eb86824 /deploy/config_parse.py
parent2f2b5814e95bed52d258b5ff339241e0b3772bee (diff)
Clarify the config file to dha file
JIRA:COMPASS-344 - make it easy Change-Id: I6e29136670f7a9f75ff90e893eff865d77235b31 Signed-off-by: grakiss <grakiss.wanglei@huawei.com>
Diffstat (limited to 'deploy/config_parse.py')
-rw-r--r--deploy/config_parse.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/deploy/config_parse.py b/deploy/config_parse.py
index 21fe76d3..ba677ade 100644
--- a/deploy/config_parse.py
+++ b/deploy/config_parse.py
@@ -34,7 +34,7 @@ def hostroles(s, seq, host=None):
def hostmacs(s, seq, host=None):
return host.get('mac', '')
-def export_config_file(s, config_file, conf_dir, ofile):
+def export_dha_file(s, dha_file, conf_dir, ofile):
env = {}
env.update(s)
if env.get('hosts', []):
@@ -44,7 +44,7 @@ def export_config_file(s, config_file, conf_dir, ofile):
env.update({'FLAVOR': s.get('FLAVOR', "cluster")})
env.update({'HOSTNAMES': hostnames(s, ',')})
env.update({'HOST_ROLES': hostroles(s, ';')})
- env.update({'DHA': config_file})
+ env.update({'DHA': dha_file})
value = hostmacs(s, ',')
if len(value) > 0:
@@ -72,15 +72,15 @@ if __name__ == "__main__":
print("parameter wrong%d %s" % (len(sys.argv), sys.argv))
sys.exit(1)
- _, config_file, conf_dir, tmpl_dir, output_dir, output_file = sys.argv
+ _, dha_file, conf_dir, tmpl_dir, output_dir, output_file = sys.argv
- if not os.path.exists(config_file):
- print("%s is not exist" % config_file)
+ if not os.path.exists(dha_file):
+ print("%s is not exist" % dha_file)
sys.exit(1)
- data = init(config_file)
+ data = init(dha_file)
- export_config_file(data, config_file, conf_dir, os.path.join(output_dir, output_file))
+ export_dha_file(data, dha_file, conf_dir, os.path.join(output_dir, output_file))
export_reset_file(data, tmpl_dir, output_dir, os.path.join(output_dir, output_file))
sys.exit(0)