[ovs-dev] [PATCH] python: Fix reporting that test-ovsdb.py command needs more args

Jakub Sitnicki jkbs at redhat.com
Wed Apr 18 10:35:08 UTC 2018

In Python OVSDB tester, we are not unpacking a value from n_args tuple
that holds the accepted range of arguments. This causes an error:

  $ python tests/test-ovsdb.py idl tests/idltest.schema
  Traceback (most recent call last):
    File "./tests/test-ovsdb.py", line 869, in <module>
    File "./tests/test-ovsdb.py", line 852, in main
      n_args, len(args)))
  TypeError: %d format: a number is required, not tuple

Signed-off-by: Jakub Sitnicki <jkbs at redhat.com>
 tests/test-ovsdb.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py
index fc42a2d68..45341dfdf 100644
--- a/tests/test-ovsdb.py
+++ b/tests/test-ovsdb.py
@@ -849,7 +849,7 @@ def main(argv):
             sys.stderr.write("%s: \"%s\" requires at least %d arguments but "
                              "only %d provided\n"
                              % (ovs.util.PROGRAM_NAME, command_name,
-                                n_args, len(args)))
+                                n_args[0], len(args)))
     elif type(n_args) == int:
         if len(args) != n_args:

More information about the dev mailing list