Changeset 10461 in genesis
- Timestamp:
- Apr 12, 2012, 9:27:12 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10460 r10461 81 81 gfile = os.path.join(NODE_DIR,item,'wleiden.yaml') 82 82 83 # Use some boring defaults 84 datadump = { 'service_proxy' : False, 'service_ileiden' : False } 83 85 f = open(gfile, 'r') 84 datadump = yaml.load(f,Loader=Loader)86 datadump.update(yaml.load(f,Loader=Loader)) 85 87 f.close() 86 88 … … 151 153 152 154 def get_hybridlist(): 153 """Get all available proxies hybridX sorting based on X number""" 154 hybridlist = sorted([os.path.basename(x) for x in glob.glob("%s/hybrid*" % NODE_DIR)], 155 key=lambda name: int(''.join([c for c in name if c in string.digits])), 156 cmp=lambda x,y: x - y) 155 """Get all available hybrid nodes/proxies""" 156 hybridlist = sorted([os.path.basename(x) for x in glob.glob("%s/Hybrid*" % NODE_DIR)]) 157 157 return hybridlist 158 158 … … 446 446 else: 447 447 normal_proxies.append(proxydump) 448 for host in get_hybridlist(): 449 hostdump = get_yaml(host) 450 if hostdump['service_ileiden']: 451 ileiden_proxies.append(hostdump) 452 if hostdump['service_proxy']: 453 normal_proxies.append(hostdump) 454 448 455 datadump['autogen_ileiden_proxies'] = ','.join([x['masterip'] for x in ileiden_proxies]) 449 456 datadump['autogen_ileiden_proxies_names'] = ','.join([x['autogen_item'] for x in ileiden_proxies]) … … 877 884 # Proxy naming convention is special 878 885 fqdn = datadump['autogen_realname'] 879 if datadump['nodetype'] == 'CNode':886 if datadump['nodetype'] in ['CNode', 'Hybrid']: 880 887 wleiden_cname[datadump['nodename']] = fqdn 881 888 … … 897 904 # First push it into a pool, to indentify the counter-part later on 898 905 addr = parseaddr(ip) 899 netmask = int(netmask)900 addr = addr & ~((1 << (32 - netmask)) - 1)906 cidr = int(cidr) 907 addr = addr & ~((1 << (32 - cidr)) - 1) 901 908 if pool.has_key(addr): 902 909 pool[addr] += [(iface_name, fqdn, ip)]
Note:
See TracChangeset
for help on using the changeset viewer.