Sfoglia il codice sorgente

Make the node list an optional argument to mkconfig and launch

Since it's unlikely to be used much in practice.  Also, this opens
up the positional command-line arguments to launch to be used in the
future for specifying the experiment to run (not yet implemented).
Ian Goldberg 1 anno fa
parent
commit
ad518986bf
2 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. 4 3
      App/launch
  2. 3 3
      App/mkconfig.py

+ 4 - 3
App/launch

@@ -45,13 +45,14 @@ if __name__ == "__main__":
         help='manifest.yaml file')
     aparse.add_argument('-p', default=PUBKEYS,
         help='pubkeys.yaml file')
-    aparse.add_argument('node', nargs='*', help='nodes to include')
+    aparse.add_argument('-n', nargs='*', help='nodes to include')
+    aparse.add_argument('cmd', nargs='*', help='experiment to run')
     args = aparse.parse_args()
 
     with open(args.m) as mf:
         manifest = yaml.safe_load(mf)
 
-    config = mkconfig.create_json(args.m, args.p, args.node)
+    config = mkconfig.create_json(args.m, args.p, args.n)
     # There must not be any newlines in the config json string
     if "\n" in config:
         print("Error: config.json must not contain embedded newlines")
@@ -59,7 +60,7 @@ if __name__ == "__main__":
     # Now add a trailing newline
     config += "\n"
 
-    nodelist = args.node
+    nodelist = args.n
     if nodelist is None or len(nodelist) == 0:
         nodelist = manifest.keys()
 

+ 3 - 3
App/mkconfig.py

@@ -6,7 +6,7 @@
 # in the manifest.yaml file.  It is an error to include a node that is
 # missing from either the manifest.yaml or the pubkeys.yaml files.
 
-# Usage: mkconfig [-m manifest.yaml] [-p pubkeys.yaml] [node1 node2...]
+# Usage: mkconfig [-m manifest.yaml] [-p pubkeys.yaml] [-n node1 node2...]
 
 import argparse
 import json
@@ -57,10 +57,10 @@ if __name__ == "__main__":
         help='manifest.yaml file')
     aparse.add_argument('-p', default=PUBKEYS,
         help='pubkeys.yaml file')
-    aparse.add_argument('node', nargs='*', help='nodes to include')
+    aparse.add_argument('-n', nargs='*', help='nodes to include')
     args = aparse.parse_args()
 
-    json = create_json(args.m, args.p, args.node)
+    json = create_json(args.m, args.p, args.n)
 
     if json is not None:
         print(json)