summaryrefslogtreecommitdiff
path: root/python/ovs
diff options
context:
space:
mode:
authorZong Kai LI <zealokii@gmail.com>2016-07-21 14:17:28 +0800
committerRussell Bryant <russell@ovn.org>2016-07-25 10:40:44 -0400
commit38c44378433b377bea6d4ff0fa4412a356cbfad3 (patch)
tree0db64425a6e9c7f71c706dd966810ed80c2ad5f4 /python/ovs
parent568b9dc8871582f968bd9e66a69a35b9acf93602 (diff)
downloadopenvswitch-38c44378433b377bea6d4ff0fa4412a356cbfad3.tar.gz
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 <zealokii@gmail.com> Acked-by: Richard Theis <rtheis@us.ibm.com> Tested-by: Richard Theis <rtheis@us.ibm.com> Signed-off-by: Russell Bryant <russell@ovn.org>
Diffstat (limited to 'python/ovs')
-rw-r--r--python/ovs/db/data.py2
1 files changed, 1 insertions, 1 deletions
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