Raise exception if DefaultController cannot find a controller

This commit is contained in:
Bob Lantz
2014-11-05 18:43:58 -08:00
parent f51eddef6d
commit ccd3276dcf
+5 -1
View File
@@ -1436,4 +1436,8 @@ def findController( controllers=DefaultControllers ):
def DefaultController( name, controllers=DefaultControllers, **kwargs ):
"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 )