- Timestamp:
- Jun 23, 2011, 6:58:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r9283 r9284 351 351 def get_yaml(item): 352 352 """ Get configuration yaml for 'item'""" 353 gfile = NODE_DIR + '/%s/wleiden.yaml' % item353 gfile = os.path.join(NODE_DIR,item,'wleiden.yaml') 354 354 355 355 f = open(gfile, 'r') … … 361 361 def store_yaml(datadump): 362 362 """ Store configuration yaml for 'item'""" 363 gfile = NODE_DIR + '/%s/wleiden.yaml' % item363 gfile = os.path.join(NODE_DIR,item,'wleiden.yaml') 364 364 365 365 f = open(gfile, 'w') … … 402 402 def write_yaml(item, datadump): 403 403 """ Write configuration yaml for 'item'""" 404 gfile = NODE_DIR + '/%s/wleiden.yaml' % item404 gfile = os.path.join(NODE_DIR,item,'wleiden.yaml') 405 405 406 406 f = open(gfile, 'w') … … 550 550 551 551 552 def make_dns( ):552 def make_dns(output_dir = 'dns'): 553 553 items = dict() 554 554 … … 615 615 ## roomburgh=CNodeRoomburgh1 616 616 ## apkerk1.CNodeVosko=172.17.176.8 ;this as well 617 dns = yaml.load(open( '../dns/staticDNS.yaml','r'))617 dns = yaml.load(open(os.path.join(NODE_DIR,'../dns/staticDNS.yaml'),'r')) 618 618 for comment, block in dns.iteritems(): 619 619 for k,v in block.iteritems(): … … 639 639 os.makedirs('dns') 640 640 details['zone'] = 'wleiden.net' 641 f = open( "dns/db." + details['zone'], "w")641 f = open(os.path.join(output_dir,"db." + details['zone']), "w") 642 642 f.write(dns_header % details) 643 643 … … 652 652 for s in range(16,32): 653 653 details['zone'] = '%i.172.in-addr.arpa' % s 654 f = open( "dns/db." + details['zone'], "w")654 f = open(os.path.join(output_dir,"db." + details['zone']), "w") 655 655 f.write(dns_header % details) 656 656 … … 668 668 print """Usage: %s <standalone [port] |test [test arguments]|static|dns> 669 669 Examples: 670 \tdns 670 \tdns [outputdir] = Generate BIND compliant zone files in dns. 671 671 \tstandalone = Run configurator webserver [default port=8000] 672 672 \tstatic = Generate all config files and store on disk … … 734 734 f.close() 735 735 elif sys.argv[1] == "dns": 736 make_dns( )736 make_dns(sys.argv[2] if sys.argv[2] else 'dns') 737 737 elif sys.argv[1] == "cleanup": 738 738 # First generate all datadumps
Note:
See TracChangeset
for help on using the changeset viewer.