usertools: fix refresh binding infos
authorTimothy Redaelli <tredaelli@redhat.com>
Fri, 31 May 2019 11:11:26 +0000 (13:11 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 4 Jul 2019 21:08:58 +0000 (23:08 +0200)
Currently clear_data (dpdk-devbind.py) doesn't work as expected
since "global devices" is missing and so "devices" is considered
a local variable.

This commit changes "clear_data" function in order to really clear
devices by adding "global devices".

Fixes: ea9f00f7289a ("usertools: refactor NIC and crypto binding details")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>
usertools/dpdk-devbind.py

index 5c1cd35..4791e5f 100755 (executable)
@@ -216,6 +216,7 @@ def get_pci_device_details(dev_id, probe_lspci):
 
 def clear_data():
     '''This function clears any old data'''
+    global devices
     devices = {}
 
 def get_device_details(devices_type):