lib/ovs/bridge: Return multiple controllers

OVSBridge may have more than one controller. Let get_controller()
return a list of controllers in such cases.

NOTE: this introduces incompatibility if multiple controllers are
configured for a bridge.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
IWAMOTO Toshihiro 2018-07-18 17:40:07 +09:00 committed by FUJITA Tomonori
parent e848eaa57e
commit b39ff68f82
1 changed files with 2 additions and 1 deletions

View File

@ -171,7 +171,8 @@ class OVSBridge(object):
"""
command = ovs_vsctl.VSCtlCommand('get-controller', [self.br_name])
self.run_command([command])
return command.result[0]
result = command.result
return result[0] if len(result) == 1 else result
def set_controller(self, controllers):
"""