- Timestamp:
- Jan 4, 2017, 9:41:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r13676 r13680 55 55 56 56 from pprint import pprint 57 from collections import defaultdict 57 from collections import defaultdict, OrderedDict 58 58 from sys import stderr 59 59 try: … … 117 117 118 118 119 ileiden_proxies = []119 ileiden_proxies = OrderedDict() 120 120 normal_proxies = [] 121 121 datadump_cache = {} … … 130 130 interface_list_cache = {} 131 131 rc_conf_local_cache = {} 132 ileiden_proxies = []132 ileiden_proxies = OrderedDict() 133 133 normal_proxies = [] 134 134 nameservers_cache = [] … … 651 651 addrs_list['lo0'].append((datadump['masterip'] + "/32", 'Master IP Not used in interface')) 652 652 653 if 'serviceid' in datadump: 654 addrs_list['lo0'].append((datadump['serviceid'] + "/32", 'Lvrouted GW IP')) 655 653 656 for iface_key in get_interface_keys(datadump): 654 657 ifacedump = datadump[iface_key] … … 739 742 datadump['autogen_ileiden_enable'] = switchFormat(datadump['autogen_ileiden_enable']) 740 743 744 745 for i in range(1,50): 746 ileiden_proxies['172.31.254.%i' % i] = {'nodename' : 'unused'} 747 741 748 if not ileiden_proxies or not normal_proxies: 742 749 for host in get_hostlist(): … … 744 751 if hostdump['status'] == 'up': 745 752 if hostdump['service_proxy_ileiden']: 746 ileiden_proxies .append(hostdump)753 ileiden_proxies[hostdump['serviceid']] = hostdump 747 754 if hostdump['service_proxy_normal']: 748 755 normal_proxies.append(hostdump) … … 750 757 datadump['autogen_ileiden_proxies'] = ileiden_proxies 751 758 datadump['autogen_normal_proxies'] = normal_proxies 752 datadump['autogen_ileiden_proxies_ips'] = ','.join([x['masterip'] for x in ileiden_proxies])753 datadump['autogen_ileiden_proxies_names'] = ','.join([x['autogen_item'] for x in ileiden_proxies])754 759 datadump['autogen_normal_proxies_ips'] = ','.join([x['masterip'] for x in normal_proxies]) 755 760 datadump['autogen_normal_proxies_names'] = ','.join([x['autogen_item'] for x in normal_proxies]) … … 798 803 # 799 804 list_ileiden_proxies=" 800 {% for item in autogen_ileiden_proxies-%}801 {{ "%-16s"|format( item.masterip) }} # {{ item.nodename }}805 {% for serviceid,item in autogen_ileiden_proxies.iteritems() -%} 806 {{ "%-16s"|format(serviceid) }} # {{ item.nodename }} 802 807 {% endfor -%} 803 808 " 804 809 list_normal_proxies=" 805 810 {% for item in autogen_normal_proxies -%} 806 {{ "%-16s"|format(item. masterip) }} # {{ item.nodename }}811 {{ "%-16s"|format(item.serviceid) }} # {{ item.nodename }} 807 812 {% endfor -%} 808 813 " … … 993 998 for config in configs: 994 999 ip_list.append(config['masterip']) 1000 if 'serviceid' in config: 1001 ip_list.append(config['serviceid']) 995 1002 for iface_key in get_interface_keys(config, True): 996 1003 l = config[iface_key]['ip']
Note:
See TracChangeset
for help on using the changeset viewer.