vendor_id and product_id in the pci_info table are exchanged

Change-Id: I97130f48b66692c91621515e781f8fa119529d53
Closes-Bug: #1742838
This commit is contained in:
Feng Shengqin 2018-01-12 10:17:36 +08:00
parent 4c7f275e2e
commit 5a06941483
2 changed files with 5 additions and 5 deletions

View File

@ -136,7 +136,7 @@ class Host(object):
{'network': pcinet_info.get('capabilities')}}
return {}
def _get_product_and_vendor(address):
def _get_vendor_and_product(address):
output, status = utils.execute('lspci', '-n', '-s', address)
value = output.split()[2]
result = value.split(":")
@ -152,7 +152,7 @@ class Host(object):
return numa_node
dev_name = 'pci_' + address.replace(":", "_").replace(".", "_")
product_id, vendor_id = _get_product_and_vendor(address)
vendor_id, product_id = _get_vendor_and_product(address)
numa_node = _get_numa_node(address)
device = {
"dev_id": dev_name,

View File

@ -132,10 +132,10 @@ rx-vlan-stag-filter: off [fixed]'''
mock_output.side_effect = values
expected = {"dev_id": "pci_0000_02_10_7",
"address": "0000:02:10.7",
"product_id": "8086",
"vendor_id": "1520",
"vendor_id": "8086",
"product_id": "1520",
"numa_node": 0,
"label": "label_1520_8086",
"label": "label_8086_1520",
"dev_type": "VF",
"parent_addr": "0000:02:10.7"}
output = os_capability_linux.LinuxHost().get_pci_resources()