Changeset 8296 in genesis


Ignore:
Timestamp:
Aug 10, 2010, 1:52:07 PM (14 years ago)
Author:
rick
Message:
  • Allow generation of all config files for testing purposes
Location:
nodes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nodes/gformat.py

    r8274 r8296  
    4646  return nodelist
    4747
     48def get_hostlist():
     49  """ Combined hosts and proxy list"""
     50  return get_nodelist() + get_proxylist()
    4851
    4952
     
    7275  """ % items
    7376
    74   for node in sorted(nodelist):
     77  for node in nodelist:
    7578    items['node'] = node
    7679    output += '<tr><td><a href="%(root)s/%(node)s">%(node)s</a></td>' % items
     
    395398  if not uri[0]:
    396399    output += "Content-type:text/html\r\n\r\n"
    397     output += generate_title(get_nodelist())
     400    output += generate_title(get_hostlist())
    398401  elif len(uri) == 1:
    399402    output += "Content-type:text/plain\r\n\r\n"
     
    408411
    409412def usage():
    410   print """Usage: %s <standalone [port] |test [test arguments]>
     413  print """Usage: %s <standalone [port] |test [test arguments]|static>
    411414Examples:
    412415\tstandalone                   =  Run configurator webserver [default port=8000]
     416\tstatic                       =  Generate all config files and store on disk
     417\t                                with format ./static/%%NODE%%/%%FILE%%
    413418\ttest CNodeRick dnsmasq.conf  =  Receive output of CGI script
    414419\t                                for arguments CNodeRick/dnsmasq.conf
     
    453458      os.environ['SCRIPT_NAME'] = __file__
    454459      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()
    455473    else:
    456474      usage()
  • nodes/make-map.py

    r8293 r8296  
    9494  write_yaml(CACHE_FILE, coordinates)
    9595  return (lam, phi)
    96 
    97 OUTFILE = 'network.png'
    9896
    9997def make_graph():
     
    136134  links = []
    137135  try:
    138     for host in gformat.get_proxylist() + gformat.get_nodelist():
     136    for host in gformat.get_hostlist():
    139137      print "## Processing host", host
    140138      datadump = gformat.get_yaml(host)
  • nodes/make-network-graph.py

    r8281 r8296  
    1717  link_type = {}
    1818  try:
    19     for host in gformat.get_proxylist() + gformat.get_nodelist():
     19    for host in gformat.get_hostlist():
    2020      print "## Processing host", host
    2121      datadump = gformat.get_yaml(host)
Note: See TracChangeset for help on using the changeset viewer.