userspace switch can be reached on unix port by dpctl

This commit is contained in:
Andrew Ferguson
2014-01-24 16:59:42 -05:00
parent 06b99c8ef2
commit 0dd96ebc57
+5 -2
View File
@@ -827,10 +827,13 @@ class UserSwitch( Switch ):
def dpctl( self, *args ):
"Run dpctl command"
listenAddr = None
if not self.listenPort:
return "can't run dpctl without passive listening port"
listenAddr = 'unix:/tmp/' + self.name
else:
listenAddr = 'tcp:127.0.0.1:%i' % self.listenPort
return self.cmd( 'dpctl ' + ' '.join( args ) +
' tcp:127.0.0.1:%i' % self.listenPort )
' ' + listenAddr )
def connected( self ):
"Is the switch connected to a controller?"