Raise exception if DefaultController cannot find a controller
This commit is contained in:
1 parent
f51eddef6d
commit
ccd3276dcf
1 file changed
+5
-1
+5
-1
@@ -1436,4 +1436,8 @@ def findController( controllers=DefaultControllers ):
|
|||||||
|
|
||||||
def DefaultController( name, controllers=DefaultControllers, **kwargs ):
|
def DefaultController( name, controllers=DefaultControllers, **kwargs ):
|
||||||
"Find a controller that is available and instantiate it"
|
"Find a controller that is available and instantiate it"
|
||||||
return findController( controllers )( name, **kwargs )
|
controller = findController( controllers )
|
||||||
|
if not controller:
|
||||||
|
raise Exception( 'Could not find a default OpenFlow controller' )
|
||||||
|
return controller( name, **kwargs )
|
||||||
|
|
||||||
Reference in new issue
Block a user