- Timestamp:
- Mar 7, 2012, 10:08:06 PM (13 years ago)
- Location:
- tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/genesis-to-yaml.pl
r10050 r10053 80 80 } else { 81 81 print "ileiden : no\n"; 82 } 83 84 foreach $key ('internalif', 'nat', 'internalroute', 'remote_access', 'gateway', 'firewall_block') { 85 if ($$key) { 86 print "$key: $$key\n"; 87 } 82 88 } 83 89 -
tools/gformat.py
r10052 r10053 277 277 output += "tproxy_enable='NO'\n" 278 278 279 # Extra Proxy configuration 280 if datadump['nodetype'] == 'Proxy': 281 output += '\n# Disable routing\ngateway_enable="no"\n' 282 283 output += '\ninternalif="%s"\n' % datadump['internalif'] 284 279 285 output += '\n' 280 286 # lo0 configuration: … … 366 372 datadump = yaml.load(f,Loader=Loader) 367 373 datadump['autogen_iface_keys'] = get_interface_keys(datadump) 374 datadump['autogen_item'] = item 368 375 f.close() 369 376 … … 372 379 def store_yaml(datadump): 373 380 """ Store configuration yaml for 'item'""" 381 item = datadump['autogen_item'] 374 382 gfile = os.path.join(NODE_DIR,item,'wleiden.yaml') 375 383 376 384 f = open(gfile, 'w') 377 del datadump['autogen_iface_keys']378 385 f.write(generate_wleiden_yaml(datadump)) 379 386 f.close() … … 412 419 413 420 414 def write_yaml(item, datadump):415 """ Write configuration yaml for 'item'"""416 gfile = os.path.join(NODE_DIR,item,'wleiden.yaml')417 418 f = open(gfile, 'w')419 f.write(format_wleiden_yaml(datadump))420 f.close()421 422 423 424 421 def generate_resolv_conf(datadump): 425 422 """ Generate configuration file '/etc/resolv.conf' """ … … 429 426 # Try local (cache) first 430 427 nameserver 127.0.0.1 431 428 """ 429 if datadump['nodetype'] == 'Proxy': 430 output += """\ 431 nameserver 8.8.8.8 # Google Public NameServer 432 nameserver 8.8.4.4 # Google Public NameServer 433 """ 434 else: 435 output += """\ 432 436 # Proxies are recursive nameservers 433 437 # needs to be in resolv.conf for dnsmasq as well 434 438 """ % datadump 435 436 for proxy in get_proxylist():437 proxy_ip = get_yaml(proxy)['masterip']438 output += "nameserver %-15s # %s\n" % (proxy_ip, proxy) 439 for proxy in get_proxylist(): 440 proxy_ip = get_yaml(proxy)['masterip'] 441 output += "nameserver %-15s # %s\n" % (proxy_ip, proxy) 442 439 443 return output 440 444 … … 478 482 def generate_wleiden_yaml(datadump): 479 483 """ Generate (petty) version of wleiden.yaml""" 484 for key in datadump.keys(): 485 if key.startswith('autogen_'): 486 del datadump[key] 487 480 488 output = generate_header("#") 481 489 output += format_wleiden_yaml(datadump) … … 843 851 datadumps[get_fqdn(datadump)] = datadump 844 852 853 for key,datadump in datadumps.iteritems(): 845 854 datadump['latitude'], datadump['longitude'] = rdnap.rd2etrs(datadump['rdnap_x'], datadump['rdnap_y']) 846 write_yaml(host,datadump)855 store_yaml(datadump) 847 856 elif sys.argv[1] == "list": 848 857 if sys.argv[2] == "nodes":
Note:
See TracChangeset
for help on using the changeset viewer.