On Thu, Jul 21, 2016 at 2:17 AM, Zong Kai LI <zealo...@gmail.com> wrote:

> 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
>

Thanks, I applied this to master with some minor updates to the commit
message.

You posted this as a "v1", but it actually appears to be a v2 of an earlier
patch.  I included the Acked-by and Tested-by headers from v1.

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

Reply via email to