From 38c44378433b377bea6d4ff0fa4412a356cbfad3 Mon Sep 17 00:00:00 2001 From: Zong Kai LI Date: Thu, 21 Jul 2016 14:17:28 +0800 Subject: [PATCH] python: add set type for ovs.idl.data.Datum.from_python ovs.db.idl.Datum.from_python fails to handle set type value, while set type is also a common iterable sequence, just like list and tuple. No reason IDL caller must to turn set type parameters to list or tuple type. Otherwise, they will fail to insert data, but get no exception. Reported-at: https://bugs.launchpad.net/networking-ovn/+bug/1605573 Signed-off-by: Zong Kai LI Acked-by: Richard Theis Tested-by: Richard Theis Signed-off-by: Russell Bryant --- python/ovs/db/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ovs/db/data.py b/python/ovs/db/data.py index 747acd5d6..6d87f89fd 100644 --- a/python/ovs/db/data.py +++ b/python/ovs/db/data.py @@ -521,7 +521,7 @@ class Datum(object): ka = Atom.from_python(type_.key, row_to_uuid(k)) va = Atom.from_python(type_.value, row_to_uuid(v)) d[ka] = va - elif isinstance(value, (list, tuple)): + elif isinstance(value, (list, set, tuple)): for k in value: ka = Atom.from_python(type_.key, row_to_uuid(k)) d[ka] = None -- 2.20.1