Changeset 8296 in genesis
- Timestamp:
- Aug 10, 2010, 1:52:07 PM (14 years ago)
- Location:
- nodes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/gformat.py
r8274 r8296 46 46 return nodelist 47 47 48 def get_hostlist(): 49 """ Combined hosts and proxy list""" 50 return get_nodelist() + get_proxylist() 48 51 49 52 … … 72 75 """ % items 73 76 74 for node in sorted(nodelist):77 for node in nodelist: 75 78 items['node'] = node 76 79 output += '<tr><td><a href="%(root)s/%(node)s">%(node)s</a></td>' % items … … 395 398 if not uri[0]: 396 399 output += "Content-type:text/html\r\n\r\n" 397 output += generate_title(get_ nodelist())400 output += generate_title(get_hostlist()) 398 401 elif len(uri) == 1: 399 402 output += "Content-type:text/plain\r\n\r\n" … … 408 411 409 412 def usage(): 410 print """Usage: %s <standalone [port] |test [test arguments] >413 print """Usage: %s <standalone [port] |test [test arguments]|static> 411 414 Examples: 412 415 \tstandalone = Run configurator webserver [default port=8000] 416 \tstatic = Generate all config files and store on disk 417 \t with format ./static/%%NODE%%/%%FILE%% 413 418 \ttest CNodeRick dnsmasq.conf = Receive output of CGI script 414 419 \t for arguments CNodeRick/dnsmasq.conf … … 453 458 os.environ['SCRIPT_NAME'] = __file__ 454 459 process_cgi_request() 460 elif sys.argv[1] == "static": 461 items = dict() 462 for node in get_hostlist(): 463 items['node'] = node 464 items['wdir'] = "./static/%(node)s" % items 465 if not os.path.isdir(items['wdir']): 466 os.makedirs(items['wdir']) 467 for config in files: 468 items['config'] = config 469 print "## Generating %(node)s %(config)s" % items 470 f = open("%(wdir)s/%(config)s" % items, "w") 471 f.write(generate_config(node, config)) 472 f.close() 455 473 else: 456 474 usage() -
nodes/make-map.py
r8293 r8296 94 94 write_yaml(CACHE_FILE, coordinates) 95 95 return (lam, phi) 96 97 OUTFILE = 'network.png'98 96 99 97 def make_graph(): … … 136 134 links = [] 137 135 try: 138 for host in gformat.get_ proxylist() + gformat.get_nodelist():136 for host in gformat.get_hostlist(): 139 137 print "## Processing host", host 140 138 datadump = gformat.get_yaml(host) -
nodes/make-network-graph.py
r8281 r8296 17 17 link_type = {} 18 18 try: 19 for host in gformat.get_ proxylist() + gformat.get_nodelist():19 for host in gformat.get_hostlist(): 20 20 print "## Processing host", host 21 21 datadump = gformat.get_yaml(host)
Note:
See TracChangeset
for help on using the changeset viewer.