Revision 686a9993 mininet/node.py

View differences:

mininet/node.py
1347 1347
                             cdir=noxCoreDir,
1348 1348
                             **kwargs )
1349 1349

  
1350
class RYU( Controller ):
1351
    "Controller to run Ryu application"
1352
    def __init__( self, name, *ryuArgs, **kwargs ):
1353
        """Init.
1354
        name: name to give controller.
1355
        ryuArgs: arguments and modules to pass to Ryu"""
1356
        homeDir = quietRun( 'printenv HOME' ).strip( '\r\n' )
1357
        ryuCoreDir = '%s/ryu/ryu/app/' % homeDir
1358
        if not ryuArgs:
1359
            warn( 'warning: no Ryu modules specified; '
1360
                  'running simple_switch only\n' )
1361
            ryuArgs = [ ryuCoreDir + 'simple_switch.py' ]
1362
        elif type( ryuArgs ) not in ( list, tuple ):
1363
            ryuArgs = [ ryuArgs ]
1364

  
1365
        Controller.__init__( self, name,
1366
                         command='ryu-manager',
1367
                         cargs='--ofp-tcp-listen-port %s ' + 
1368
                         ' '.join( ryuArgs ),
1369
                         cdir=ryuCoreDir,
1370
                         **kwargs )
1350 1371

  
1351 1372
class RemoteController( Controller ):
1352 1373
    "Controller running outside of Mininet's control."

Also available in: Unified diff