Authored by chunhua.zhang

解决gen inventory的bug

# inventory file for az1
# auto generated at 2018-10-31 14:49:29
# auto generated at 2018-10-31 17:02:08
[nameservers]
10.66.4.18
... ... @@ -93,8 +93,12 @@
[java-message]
10.66.70.100
10.66.70.109
10.66.70.47
10.66.70.96
10.66.70.190
10.66.70.143
10.66.70.58
10.66.70.19
[java-order]
... ...
# inventory file for az2
# auto generated at 2018-10-30 11:27:31
# auto generated at 2018-10-31 17:02:08
[nameservers]
10.66.105.5
... ...
# inventory file for az2
# auto generated at 2018-10-29 18:16:36
# auto generated at 2018-10-31 17:02:08
[nameservers]
10.66.200.10
... ...
... ... @@ -59,7 +59,7 @@ for _az in azs_mappings.keys():
file = open(os.path.join(PATH, "scripts/iptable/", _az, "app-iptable.sh"), 'r')
for line in file:
for deploy_prj_name in host_group.keys():
if line.strip().startswith(deploy_prj_name):
if line.strip().startswith(deploy_prj_name + "_" + _az):
g_hosts = []
groups[host_group[deploy_prj_name]] = g_hosts
i_1 = line.index("(")
... ...