[NFVBENCH-159] Python3 fix for get_intel_pci() 30/69730/1 4.2.1
authormklyus <mklyus@cisco.com>
Sun, 23 Feb 2020 22:02:15 +0000 (01:02 +0300)
committerYichen Wang <yicwang@cisco.com>
Mon, 24 Feb 2020 21:15:55 +0000 (13:15 -0800)
Change-Id: I09d1f1180b0e80a34a0eec1acf4a1681b15d3e34
Signed-off-by: Yichen Wang <yicwang@cisco.com>
nfvbench/utils.py

index c8c485f..94cc11d 100644 (file)
@@ -144,7 +144,7 @@ def get_intel_pci(nic_slot=None, nic_ports=None):
         devices = ''
 
     for driver in ['i40e', 'ixgbe']:
-        matches = re.findall(regex.format(hx=hx, driver=driver), devices)
+        matches = re.findall(regex.format(hx=hx, driver=driver), devices.decode("utf-8"))
         if not matches:
             continue
 
@@ -160,9 +160,8 @@ def get_intel_pci(nic_slot=None, nic_ports=None):
                                            stdout=subprocess.PIPE,
                                            stderr=subprocess.PIPE)
                 intf_info, _ = process.communicate()
-                if not re.search('team_slave|bond_slave', intf_info):
+                if not re.search('team_slave|bond_slave', intf_info.decode("utf-8")):
                     pcis.append(port[1])
-
             if len(pcis) == 2:
                 break