Commit 56e49303 authored by Simon Redman's avatar Simon Redman

Ignore 'consumer device host nodes' per updated emulab profile

parent 0d7be1f5
......@@ -27,6 +27,7 @@ import topomap_parser
import argparse
import getpass
from netdiff import NetJsonParser
import re
if __name__ == "__main__":
parser = argparse.ArgumentParser("Setup an Emulab experiment for Segment Routing")
......@@ -40,8 +41,10 @@ if __name__ == "__main__":
help="Username to use on all hosts. Defaults to current user's username")
parser.add_argument("--stop", action='store_true',
help="Stop all services (after writing config files)")
parser.add_argument("--ovs-prefix", action='store', type=str, default='ovs',
help="Prefix used in Emulab profile to distinguish OVS nodes (Default \"ovs\")")
parser.add_argument("--ovs-regex", action='store', type=str, default='.*ovs.*',
help="Regex to distinguish OVS nodes by label (Default \".*ovs.*\")")
parser.add_argument("--host-regex", action='store', type=str, default='.*host.*',
help="Regex to distinguish host nodes by label (Default \".*host.*\")")
args = parser.parse_args()
......@@ -60,15 +63,22 @@ if __name__ == "__main__":
add_routable_ipv6_addrs.add_ULAs_to_hosts(netgraph.graph, ULA_map)
add_routable_ipv6_addrs.add_interfaces_to_netgraph(netgraph.graph, ULA_map)
# Prepare a list of nodes which run OVS and should thus be ignore for router-related activites
ovs_nodes = []
for node in netgraph.graph.nodes:
node_name = netgraph.graph._node[node]['label']
if str.startswith(node_name, args.ovs_prefix):
if re.match(args.ovs_regex, node_name):
# TODO: Make frr_configurator ignore OVS nodes
frr_configurator.configure_nodes(netgraph.graph, ignore_nodes=ovs_nodes)
frr_configurator.start_frr_on_network(netgraph.graph, ignore_nodes=ovs_nodes)
# Prepare a list of nodes which are "consumer host nodes" and should thus be ignored for core network-related activities
host_nodes = []
for node in netgraph.graph.nodes:
node_name = netgraph.graph._node[node]['label']
if re.match(args.host_regex, node_name):
frr_configurator.configure_nodes(netgraph.graph, ignore_nodes=ovs_nodes + host_nodes)
frr_configurator.start_frr_on_network(netgraph.graph, ignore_nodes=ovs_nodes + host_nodes)
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