Changed custom feature so that params aren't added to globals.
There is probably a better way of doing this, but currently parseCustomFile can modify globals (e.g. TOPOS) as well as instance variables (self.validate) and classes (e.g. MyTopo), which are also in the global name space. Inconveniently enough, lambdas don't seem to be full closures in Python; if they were, this trickiness would be unnecessary. Even so, using execfile() seems like it might be a bit dubious...
This commit is contained in:
+1
-2
@@ -88,8 +88,7 @@ class CLI( Cmd ):
|
||||
|
||||
def do_net( self, args ):
|
||||
"List network connections."
|
||||
for switchDpid in self.mn.topo.switches():
|
||||
switch = self.mn.nodes[ switchDpid ]
|
||||
for switch in self.mn.switches:
|
||||
info( '%s <->', switch.name )
|
||||
for intf in switch.intfs:
|
||||
node = switch.connection[ intf ]
|
||||
|
||||
+2
-2
@@ -303,14 +303,14 @@ class Mininet( object ):
|
||||
ip = topo.ip( hostId )
|
||||
host = self.addHost( name, defaultIp=ip, defaultMac=mac )
|
||||
self.idToNode[ hostId ] = host
|
||||
info( name )
|
||||
info( name + ' ' )
|
||||
info( '\n*** Adding switches:\n' )
|
||||
for switchId in sorted( topo.switches() ):
|
||||
name = 's' + topo.name( switchId )
|
||||
mac = macColonHex( switchId) if self.setMacs else None
|
||||
switch = self.addSwitch( name, defaultMac=mac )
|
||||
self.idToNode[ switchId ] = switch
|
||||
info( name )
|
||||
info( name + ' ' )
|
||||
info( '\n*** Adding edges:\n' )
|
||||
for srcId, dstId in sorted( topo.edges() ):
|
||||
src, dst = self.idToNode[ srcId ], self.idToNode[ dstId ]
|
||||
|
||||
Reference in New Issue
Block a user