Revision 72fd120d mininet/net.py

View differences:

mininet/net.py
95 95

  
96 96
from mininet.cli import CLI
97 97
from mininet.log import info, error, debug, output
98
from mininet.node import Host, OVSKernelSwitch, Controller
98
from mininet.node import Host, OVSKernelSwitch, DefaultController, Controller
99 99
from mininet.link import Link, Intf
100 100
from mininet.util import quietRun, fixLimits, numCores, ensureRoot
101 101
from mininet.util import macColonHex, ipStr, ipParse, netParse, ipAdd
......
213 213
        if not controller:
214 214
            controller = self.controller
215 215
        # Construct new controller if one is not given
216
        if isinstance(name, Controller):
216
        if isinstance( name, Controller ):
217 217
            controller_new = name
218 218
            # Pylint thinks controller is a str()
219 219
            # pylint: disable=E1103
220 220
            name = controller_new.name
221 221
            # pylint: enable=E1103
222 222
        else:
223
            # bookmark
223 224
            controller_new = controller( name, **params )
224 225
        # Add new controller to net
225
        if controller_new:  # allow controller-less setups
226
        if controller_new: # allow controller-less setups
226 227
            self.controllers.append( controller_new )
227 228
            self.nameToNode[ name ] = controller_new
228 229
        return controller_new

Also available in: Unified diff