diff mbox series

[ovs-dev] python: allow UnixctlClient to get argv as tuple in transact

Message ID 20200316032947.2252-1-moshele@mellanox.com
State Deferred
Headers show
Series [ovs-dev] python: allow UnixctlClient to get argv as tuple in transact | expand

Commit Message

Moshe Levi March 16, 2020, 3:29 a.m. UTC
Currently transact check that argv is of type list. This patch
allow argv also to be tuple.

Signed-off-by: Moshe Levi <moshele@mellanox.com>
---
 python/ovs/unixctl/client.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilya Maximets Oct. 18, 2022, 11:48 a.m. UTC | #1
On 3/16/20 04:29, Moshe Levi wrote:
> Currently transact check that argv is of type list. This patch
> allow argv also to be tuple.
> 
> Signed-off-by: Moshe Levi <moshele@mellanox.com>
> ---
>  python/ovs/unixctl/client.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/python/ovs/unixctl/client.py b/python/ovs/unixctl/client.py
> index 8283f99bb..50f619f4b 100644
> --- a/python/ovs/unixctl/client.py
> +++ b/python/ovs/unixctl/client.py
> @@ -28,7 +28,7 @@ class UnixctlClient(object):
>  
>      def transact(self, command, argv):
>          assert isinstance(command, str)
> -        assert isinstance(argv, list)
> +        assert isinstance(argv, (list, tuple))
>          for arg in argv:
>              assert isinstance(arg, str)
>  

Hi.  Sorry for digging that up, but I'm looking through old
patches in a patchwork today.

FOr this change I see the description, but the motivation
is unclear.  What problem does this patch solve or is it
still necessary?

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/python/ovs/unixctl/client.py b/python/ovs/unixctl/client.py
index 8283f99bb..50f619f4b 100644
--- a/python/ovs/unixctl/client.py
+++ b/python/ovs/unixctl/client.py
@@ -28,7 +28,7 @@  class UnixctlClient(object):
 
     def transact(self, command, argv):
         assert isinstance(command, str)
-        assert isinstance(argv, list)
+        assert isinstance(argv, (list, tuple))
         for arg in argv:
             assert isinstance(arg, str)