- Timestamp:
- Oct 31, 2010, 9:24:42 PM (14 years ago)
- Location:
- tools
- Files:
-
- 1 added
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r8615 r8622 4 4 # Wireless Leiden configuration generator, based on yaml files' 5 5 # Rick van der Zwet <info@rickvanderzwet.nl> 6 7 # Hack to make the script directory is also threated as a module search path. 8 import sys 9 import os 10 sys.path.append(os.path.dirname(__file__)) 11 6 12 import cgi 7 13 import cgitb 8 14 import copy 9 15 import glob 10 import os11 16 import socket 12 17 import string 13 18 import subprocess 14 import sys15 19 import time 16 import make_map20 import rdnap 17 21 from pprint import pprint 18 22 try: … … 31 35 32 36 33 NODE_DIR = os. path.dirname(os.path.realpath(__file__))37 NODE_DIR = os.getcwd() 34 38 __version__ = '$Id$' 35 39 … … 608 612 ## roomburgh=CNodeRoomburgh1 609 613 ## apkerk1.CNodeVosko=172.17.176.8 ;this as well 610 f = open('../dns/staticDNS.conf','r') 611 for l in f.readlines(): 612 # Get rid of comments 613 l = l.strip().split(';')[0].strip() 614 if l: 615 k,v = l.split('=') 614 dns = yaml.load(open('../dns/staticDNS.yaml','r')) 615 for comment, block in dns.iteritems(): 616 for k,v in block.iteritems(): 616 617 if valid_addr(v): 617 618 wleiden_zone[k] = v 618 619 else: 619 620 wleiden_cname[k] = v 620 f.close()621 621 622 622 details = dict() … … 734 734 datadumps[get_fqdn(datadump)] = datadump 735 735 736 datadump['latitude'], datadump['longitude'] = make_map.rd2etrs(datadump['rdnap_x'], datadump['rdnap_y'])736 datadump['latitude'], datadump['longitude'] = rdnap.rd2etrs(datadump['rdnap_x'], datadump['rdnap_y']) 737 737 write_yaml(host, datadump) 738 738 else:
Note:
See TracChangeset
for help on using the changeset viewer.