...
 
Commits (2)
......@@ -83,15 +83,17 @@ if __name__ == "__main__":
host_nodes.append(node)
frr_configurator.configure_nodes(netgraph.graph, ignore_nodes=ovs_nodes)
frr_configurator.start_frr_on_network(netgraph.graph, ignore_nodes=ovs_nodes)
sysctl_configurator.configure_nodes(netgraph.graph,ignore_nodes=ovs_nodes)
ospf_sniffer_configurator.clone_repo_on_network(netgraph.graph, ignore_nodes=ovs_nodes + host_nodes)
ospf_sniffer_configurator.stop_sniffer_on_network(netgraph.graph, ignore_nodes=ovs_nodes + host_nodes) # Stopping with the app not running is not great, but better than starting twice
ospf_sniffer_configurator.start_sniffer_on_network(netgraph.graph,
controller=args.controller_name,
port=args.controller_port,
ignore_nodes=ovs_nodes + host_nodes)
if not args.stop:
frr_configurator.start_frr_on_network(netgraph.graph, ignore_nodes=ovs_nodes)
ospf_sniffer_configurator.start_sniffer_on_network(netgraph.graph,
controller=args.controller_name,
port=args.controller_port,
ignore_nodes=ovs_nodes + host_nodes)
ssh_helper.network_graph_logout(netgraph.graph)
......
......@@ -71,7 +71,7 @@ def _generate_start_command(path:str=DEFAULT_CLONE_PATH,
:param pidfile: File to which the PID will be written
:return:
"""
return "pushd {path}; ./python-sudo.sh {executable} --controller={controller} --port={port} --log-file={logfile} & echo $! > {pidfile} && disown; popd".format(
return "pushd {path}; source env/bin/activate; sudo $(which python) {executable} --controller={controller} --port={port} --log-file={logfile} & echo $! > {pidfile} && disown; deactivate; popd".format(
path=path,
executable=executable,
controller=controller,
......@@ -81,7 +81,7 @@ def _generate_start_command(path:str=DEFAULT_CLONE_PATH,
)
def _generate_stop_command(pidfile: str=DEFAULT_PIDFILE) -> str:
return "kill $(cat {pidfile}); rm -f {pidfile}".format(pidfile=pidfile)
return "sudo kill $(cat {pidfile}); rm -f {pidfile}".format(pidfile=pidfile)
def clone_repo_on_network(graph: networkx.Graph,
......