Changeset 10567 in genesis for tools


Ignore:
Timestamp:
Apr 24, 2012, 5:42:39 PM (13 years ago)
Author:
rick
Message:

Ideetje van richard op active machines weer te geven wat beter in de huidige
setup weergeven (help aangepast).

Verder de list <iets> uitgebreid zodat ook andere features weergeven kunnen
worden.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r10564 r10567  
    10461046
    10471047def usage():
    1048   print """Usage: %s <standalone [port] |test [test arguments]|static|dns>
    1049 Examples:
    1050 \tdns [outputdir]              =  Generate BIND compliant zone files in dns.
    1051 \tstandalone                   =  Run configurator webserver [default port=8000]
    1052 \twind-export                  =  Generate SQL import scripts for WIND database
     1048  print """Usage: %(prog)s <argument>
     1049Argument:
     1050\tstandalone [port]            =  Run configurator webserver [8000]
     1051\tdns [outputdir]              =  Generate BIND compliant zone files in dns [./dns]
    10531052\tfull-export                  =  Generate yaml export script for heatmap.
    1054 \tstatic [./static]            =  Generate all config files and store on disk
    1055 \t                                with format ./static/%%NODE%%/%%FILE%%
    1056 \ttest CNodeRick dnsmasq.conf  =  Receive output of CGI script
    1057 \t                                for arguments CNodeRick/dnsmasq.conf
    1058 \tlist <all|nodes|proxies>     =  List systems which marked up.
     1053\tstatic [outputdir]           =  Generate all config files and store on disk
     1054\t                                with format ./<outputdir>/%%NODE%%/%%FILE%% [./static]
     1055\ttest <node> <file>           =  Receive output of CGI script.
     1056\tlist <status> <items>        =  List systems which have certain status
     1057
     1058Arguments:
     1059\t<node>    = NodeName (example: HybridRick)
     1060\t<file>    = %(files)s
     1061\t<status>  = all|up|down|planned
     1062\t<items>   = systems|nodes|proxies
    10591063
    10601064NOTE FOR DEVELOPERS; you can test your changes like this:
     
    10651069  VIEW differences and VERIFY all are OK:
    10661070  $ diff -urI 'Generated' -r /tmp/pre /tmp/post
    1067 """
     1071""" % { 'prog' : sys.argv[0], 'files'  : '|'.join(files) }
    10681072  exit(0)
    10691073
     
    12221226        store_yaml(datadump)
    12231227    elif sys.argv[1] == "list":
    1224       if sys.argv[2] == "nodes":
     1228      if len(sys.argv) < 4 or not sys.argv[2] in ["up", "down", "planned", "all"]:
     1229        usage()
     1230      if sys.argv[3] == "nodes":
    12251231        systems = get_nodelist()
    1226       elif sys.argv[2] == "proxies":
     1232      elif sys.argv[3] == "proxies":
    12271233        systems = get_proxylist()
    1228       elif sys.argv[2] == "all":
     1234      elif sys.argv[3] == "systems":
    12291235        systems = get_hostlist()
    12301236      else:
     
    12321238      for system in systems:
    12331239       datadump = get_yaml(system)
    1234        if datadump['status'] == "up":
     1240       if sys.argv[2] == "all":
     1241         print system
     1242       elif datadump['status'] == sys.argv[2]:
    12351243         print system
    12361244    elif sys.argv[1] == "create":
Note: See TracChangeset for help on using the changeset viewer.