Skip to contentSkip to conversation

usertools/pmdinfo: fix plugin auto scan

PATCH Applied David Marchand 3 participants 3 messages Oct 19, 2021 – Oct 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usertools/pmdinfo: fix plugin auto scan

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")
---
 usertools/dpdk-pmdinfo.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
usertools/dpdk-pmdinfo.py +1 -1
index 3381aa616c..40ef5cec6c 100755
@@ -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:
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1
#1 lore raw

Hello,

2021-10-19, David Marchand:

Quoted 10 lines

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
Quoted 4 lines
Fixes 81255f27c65c ("usertools: replace optparse with argparse")

It is sad that pylint does not report an error:

https://pycodequ.al/docs/pylint-messages/e1136-unsubscriptable-object.html

Anyway, this fix looks good.

#2 lore raw

20/10/2021 21:31, Robin Jarry:

Quoted 18 lines

Hello,

2021-10-19, David Marchand:

Quoted 10 lines

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
Quoted 4 lines
Fixes 81255f27c65c ("usertools: replace optparse with argparse")
Quoted 7 lines

It is sad that pylint does not report an error:

https://pycodequ.al/docs/pylint-messages/e1136-unsubscriptable-object.html

Anyway, this fix looks good.

Applied, thanks.