- Timestamp:
- Apr 24, 2012, 5:42:39 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10564 r10567 1046 1046 1047 1047 def 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> 1049 Argument: 1050 \tstandalone [port] = Run configurator webserver [8000] 1051 \tdns [outputdir] = Generate BIND compliant zone files in dns [./dns] 1053 1052 \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 1058 Arguments: 1059 \t<node> = NodeName (example: HybridRick) 1060 \t<file> = %(files)s 1061 \t<status> = all|up|down|planned 1062 \t<items> = systems|nodes|proxies 1059 1063 1060 1064 NOTE FOR DEVELOPERS; you can test your changes like this: … … 1065 1069 VIEW differences and VERIFY all are OK: 1066 1070 $ diff -urI 'Generated' -r /tmp/pre /tmp/post 1067 """ 1071 """ % { 'prog' : sys.argv[0], 'files' : '|'.join(files) } 1068 1072 exit(0) 1069 1073 … … 1222 1226 store_yaml(datadump) 1223 1227 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": 1225 1231 systems = get_nodelist() 1226 elif sys.argv[ 2] == "proxies":1232 elif sys.argv[3] == "proxies": 1227 1233 systems = get_proxylist() 1228 elif sys.argv[ 2] == "all":1234 elif sys.argv[3] == "systems": 1229 1235 systems = get_hostlist() 1230 1236 else: … … 1232 1238 for system in systems: 1233 1239 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]: 1235 1243 print system 1236 1244 elif sys.argv[1] == "create":
Note:
See TracChangeset
for help on using the changeset viewer.