From 03c67d368dfa19bba6f070b060fb15aace4dd703 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Fri, 2 Jun 2017 16:45:12 +0900 Subject: [PATCH] service/ovsdb: Default of controller_info in set_controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 胡鼎原 Signed-off-by: IWASE Yusuke Signed-off-by: FUJITA Tomonori --- ryu/services/protocols/ovsdb/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ryu/services/protocols/ovsdb/api.py b/ryu/services/protocols/ovsdb/api.py index c1f04398..9443d750 100644 --- a/ryu/services/protocols/ovsdb/api.py +++ b/ryu/services/protocols/ovsdb/api.py @@ -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)