added default controller class

This commit is contained in:
Cody Burkard
2014-07-11 19:04:20 -07:00
parent 1aed2b8abd
commit 72fd120dc8
3 changed files with 16 additions and 5 deletions
+9
View File
@@ -1278,6 +1278,15 @@ class Controller( Node ):
self.__class__.__name__, self.name,
self.IP(), self.port, self.pid )
class DefaultController( Controller ):
"find any controller that is available and run it"
def __init__( self, name, **kwargs ):
"search for any installed controller"
controllers = [ 'controller', 'ovs-controller', 'test-controller' ] # , 'pox', 'ryu' ] # test-controller is the important part
for c in controllers:
if quietRun( "which " + c ):
Controller.__init__( self, name, controller=c, **kwargs )
break
class OVSController( Controller ):
"Open vSwitch controller"