usertools/pmdinfo: fix plugin auto scan
authorDavid Marchand <david.marchand@redhat.com>
Tue, 19 Oct 2021 12:52:30 +0000 (14:52 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 25 Oct 2021 15:09:01 +0000 (17:09 +0200)
Migration to argparse was incomplete.

$ dpdk-pmdinfo.py -p $(which dpdk-testpmd)
Traceback (most recent call last):
  File "/usr/bin/dpdk-pmdinfo.py", line 626, in <module>
    main()
  File "/usr/bin/dpdk-pmdinfo.py", line 596, in main
    exit(scan_for_autoload_pmds(args[0]))
TypeError: 'Namespace' object does not support indexing

Fixes: 81255f27c65c ("usertools: replace optparse with argparse")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Robin Jarry <robin.jarry@6wind.com>
usertools/dpdk-pmdinfo.py

index 3381aa6..40ef5ce 100755 (executable)
@@ -593,7 +593,7 @@ def main(stream=None):
             exit(1)
 
     if args.pdir:
-        exit(scan_for_autoload_pmds(args[0]))
+        exit(scan_for_autoload_pmds(args.elf_file))
 
     ldlibpath = os.environ.get('LD_LIBRARY_PATH')
     if ldlibpath is None: