Skip to content
Snippets Groups Projects
Commit b1f90976 authored by Bob Lantz's avatar Bob Lantz
Browse files

Remove default classes since Mininet() really handles them.

parent 4ac1148e
No related branches found
No related tags found
No related merge requests found
...@@ -18,11 +18,6 @@ ...@@ -18,11 +18,6 @@
from networkx import Graph from networkx import Graph
from mininet.node import SWITCH_PORT_BASE, Host, OVSSwitch from mininet.node import SWITCH_PORT_BASE, Host, OVSSwitch
# BL: it's hard to figure out how to do this right yet remain flexible
# These classes will be used as the defaults if no class is passed
# into either Topo() or Node()
TopoDefaultNode = Host
TopoDefaultSwitch = OVSSwitch
class NodeID(object): class NodeID(object):
'''Topo node identifier.''' '''Topo node identifier.'''
...@@ -81,11 +76,13 @@ def __init__(self, connected=False, admin_on=True, ...@@ -81,11 +76,13 @@ def __init__(self, connected=False, admin_on=True,
self.power_on = power_on self.power_on = power_on
self.fault = fault self.fault = fault
self.is_switch = is_switch self.is_switch = is_switch
# Above should be deleted and replaced by the following # BL: Above should mostly be deleted and replaced by the following
# BL: is_switch is a bit annoying if we can just specify # is_switch is a bit annoying if we are already specifying
# the node class instead!! # a switch class!! Except that if cls is not specified,
self.cls = cls if cls else ( TopoDefaultSwitch if is_switch else TopoDefaultNode ) # then Mininet() knows whether to create a switch or a host
self.params = params if params else {} # node and can call its own constructors...
self.cls = cls
self.params = params
class Edge(object): class Edge(object):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment