Commit 0d7be1f5 authored by Simon Redman's avatar Simon Redman

Allow orchestrator to write resulting NetJSON file

parent 742495bf
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
import add_routable_ipv6_addrs import add_routable_ipv6_addrs
import frr_configurator import frr_configurator
import json
import ssh_helper import ssh_helper
import sysctl_configurator import sysctl_configurator
import topomap_parser import topomap_parser
...@@ -33,6 +34,8 @@ if __name__ == "__main__": ...@@ -33,6 +34,8 @@ if __name__ == "__main__":
help="Path to the emulab topomap file to parse") help="Path to the emulab topomap file to parse")
parser.add_argument("--netgraph-file", action='store', type=str, required=False, parser.add_argument("--netgraph-file", action='store', type=str, required=False,
help="Path to the NetJSON file to parse. Skips parsing the netgrap from the topomap-file") help="Path to the NetJSON file to parse. Skips parsing the netgrap from the topomap-file")
parser.add_argument("--netgraph-write", action='store', type=str, required=False,
help="(Optional) Path to write the final NetJSON file")
parser.add_argument("--username", action='store', type=str, default=getpass.getuser(), parser.add_argument("--username", action='store', type=str, default=getpass.getuser(),
help="Username to use on all hosts. Defaults to current user's username") help="Username to use on all hosts. Defaults to current user's username")
parser.add_argument("--stop", action='store_true', parser.add_argument("--stop", action='store_true',
...@@ -70,3 +73,7 @@ if __name__ == "__main__": ...@@ -70,3 +73,7 @@ if __name__ == "__main__":
sysctl_configurator.configure_nodes(netgraph.graph,ignore_nodes=ovs_nodes) sysctl_configurator.configure_nodes(netgraph.graph,ignore_nodes=ovs_nodes)
ssh_helper.network_graph_logout(netgraph.graph) ssh_helper.network_graph_logout(netgraph.graph)
if args.netgraph_write:
with open(args.netgraph_write) as outfile:
json.dumps(netgraph.json(dict=True), outfile)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment