service/ovsdb: Default of controller_info in set_controller

Currently, api.set_controller in OVSDB service raises AttributeError if
controller_info is None and controller is not found in current table.

This patch sets the empty dict as the default value and fixes this
problem.

Reported-by: 胡鼎原 <hdyvip@gmail.com>
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
IWASE Yusuke 2017-06-02 16:45:12 +09:00 committed by FUJITA Tomonori
parent 574e417d9d
commit 03c67d368d
1 changed files with 2 additions and 0 deletions

View File

@ -364,6 +364,8 @@ def del_port_by_name(manager, system_id, bridge_name, port_name):
def set_controller(manager, system_id, bridge_name,
target, controller_info=None):
controller_info = controller_info or {}
def _set_controller(tables, insert):
bridge = _get_bridge(tables, bridge_name)