Changeset 9971 in genesis for tools


Ignore:
Timestamp:
Feb 15, 2012, 6:13:37 PM (13 years ago)
Author:
rick
Message:

Allow generating list from CLI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r9958 r9971  
    736736\ttest CNodeRick dnsmasq.conf  =  Receive output of CGI script
    737737\t                                for arguments CNodeRick/dnsmasq.conf
     738\tlist <nodes|proxies>         =  List systems which marked up.
    738739"""
    739740  exit(0)
     
    844845        datadump['latitude'], datadump['longitude'] = rdnap.rd2etrs(datadump['rdnap_x'], datadump['rdnap_y'])
    845846        write_yaml(host, datadump)
     847    elif sys.argv[1] == "list":
     848      if sys.argv[2] == "nodes":
     849        systems = get_nodelist()
     850      elif sys.argv[2] == "proxies":
     851        systems = get_proxylist()
     852      else:
     853        usage()
     854      for system in systems:
     855       datadump = get_yaml(system)
     856       if datadump['status'] == "up":
     857         print system
    846858    else:
    847859      usage()
Note: See TracChangeset for help on using the changeset viewer.