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.

Signed-off-by: Zong Kai LI <zealo...@gmail.com>
---
 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 747acd5..6d87f89 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
-- 
1.9.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to