Changeset 10860 in genesis
- Timestamp:
- May 15, 2012, 12:09:50 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10825 r10860 95 95 UNKNOWN = 90 96 96 97 datadump_cache = {} 98 97 99 def get_yaml(item): 98 100 """ Get configuration yaml for 'item'""" 101 if datadump_cache.has_key(item): 102 return datadump_cache[item].copy() 103 99 104 gfile = os.path.join(NODE_DIR,item,'wleiden.yaml') 100 105 … … 136 141 datadump['autogen_domain'] = datadump['domain'] if datadump.has_key('domain') else 'wleiden.net.' 137 142 datadump['autogen_fqdn'] = datadump['autogen_realname'] + '.' + datadump['autogen_domain'] 143 datadump_cache[item] = datadump.copy() 138 144 return datadump 139 145 … … 477 483 478 484 485 ileiden_proxies = [] 486 normal_proxies = [] 487 rc_conf_local_cache = {} 479 488 480 489 def generate_rc_conf_local(datadump): 481 490 """ Generate configuration file '/etc/rc.conf.local' """ 491 item = datadump['autogen_item'] 492 if rc_conf_local_cache.has_key(item): 493 return rc_conf_local_cache[item] 494 482 495 if not datadump.has_key('ileiden'): 483 496 datadump['autogen_ileiden_enable'] = False … … 487 500 datadump['autogen_ileiden_enable'] = switchFormat(datadump['autogen_ileiden_enable']) 488 501 489 ileiden_proxies = [] 490 normal_proxies = [] 491 for proxy in get_proxylist(): 492 proxydump = get_yaml(proxy) 493 if proxydump['ileiden']: 494 ileiden_proxies.append(proxydump) 495 else: 496 normal_proxies.append(proxydump) 497 for host in get_hybridlist(): 498 hostdump = get_yaml(host) 499 if hostdump['service_proxy_ileiden']: 500 ileiden_proxies.append(hostdump) 501 if hostdump['service_proxy_normal']: 502 normal_proxies.append(hostdump) 502 if not ileiden_proxies or not normal_proxies: 503 for proxy in get_proxylist(): 504 proxydump = get_yaml(proxy) 505 if proxydump['ileiden']: 506 ileiden_proxies.append(proxydump) 507 else: 508 normal_proxies.append(proxydump) 509 for host in get_hybridlist(): 510 hostdump = get_yaml(host) 511 if hostdump['service_proxy_ileiden']: 512 ileiden_proxies.append(hostdump) 513 if hostdump['service_proxy_normal']: 514 normal_proxies.append(hostdump) 503 515 504 516 datadump['autogen_ileiden_proxies'] = ileiden_proxies … … 713 725 output += "ipv4_addrs_%s='%s'\n\n" % (iface, " ".join([x[0] for x in addrs])) 714 726 727 rc_conf_local_cache[datadump['autogen_item']] = output 715 728 return output 716 729
Note:
See TracChangeset
for help on using the changeset viewer.