Clean up (and fix) OVSSwitch fast reconnect
This commit is contained in:
+5
-5
@@ -976,12 +976,12 @@ class OVSSwitch( Switch ):
|
|||||||
clist += ' ptcp:%s' % self.listenPort
|
clist += ' ptcp:%s' % self.listenPort
|
||||||
self.cmd( 'ovs-vsctl set-controller', self, clist )
|
self.cmd( 'ovs-vsctl set-controller', self, clist )
|
||||||
# Set controllers to reconnect quickly
|
# Set controllers to reconnect quickly
|
||||||
controllers = self.cmd( 'ovs-vsctl --columns=controller find Bridge '
|
controllers = self.cmd( 'ovs-vsctl -- get Bridge', self,
|
||||||
'name=' + str(self) ).split(':',2)[-1].strip()
|
'Controller' ).strip()
|
||||||
|
|
||||||
if controllers.startswith( '[' ) and controllers.endswith( ']' ):
|
if controllers.startswith( '[' ) and controllers.endswith( ']' ):
|
||||||
controllers = [c.strip() for c in controllers[1:-1].split(',')]
|
controllers = controllers[ 1 : -1 ]
|
||||||
for uuid in controllers:
|
uuids = [ c.strip() for c in controllers.split( ',' ) ]
|
||||||
|
for uuid in uuids:
|
||||||
if uuid.count('-') != 4:
|
if uuid.count('-') != 4:
|
||||||
# Doesn't look like a UUID
|
# Doesn't look like a UUID
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user