Commit aac7222f authored by Simon Redman's avatar Simon Redman

Add optional argument to stop frr

parent 10c95a36
...@@ -251,6 +251,8 @@ if __name__ == "__main__": ...@@ -251,6 +251,8 @@ if __name__ == "__main__":
help="Path to the NetJSON file to parse") help="Path to the NetJSON file to parse")
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', type=bool, default=False,
help="Stop all services (after writing config files)")
args = parser.parse_args() args = parser.parse_args()
...@@ -258,6 +260,10 @@ if __name__ == "__main__": ...@@ -258,6 +260,10 @@ if __name__ == "__main__":
ssh_helper.network_graph_login(netgraph.graph, args.username) ssh_helper.network_graph_login(netgraph.graph, args.username)
configure_nodes(netgraph.graph) configure_nodes(netgraph.graph)
if args.stop:
stop_frr_on_network(netgraph.graph)
else:
start_frr_on_network(netgraph.graph) start_frr_on_network(netgraph.graph)
ssh_helper.network_graph_logout(netgraph.graph) ssh_helper.network_graph_logout(netgraph.graph)
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