Bug-fix: attach_type or control path type should be majuscule.

The sysinfo based fpga driver report attach_type or control path type as "pci"
which will cause an error of creating related object in conductor.

Change-Id: I442511d3232da90484886dbf169b53b8acf4681c
This commit is contained in:
Xinran WANG 2019-04-04 15:01:27 +08:00
parent 80f638ac51
commit d4b83a1498
2 changed files with 6 additions and 6 deletions

View File

@ -169,7 +169,7 @@ def _generate_driver_device(fpga, pf_has_vf):
def _generate_controlpath_id(fpga): def _generate_controlpath_id(fpga):
driver_cpid = driver_controlpath_id.DriverControlPathID() driver_cpid = driver_controlpath_id.DriverControlPathID()
driver_cpid.cpid_type = "pci" driver_cpid.cpid_type = "PCI"
driver_cpid.cpid_info = fpga["devices"] driver_cpid.cpid_info = fpga["devices"]
return driver_cpid return driver_cpid
@ -198,7 +198,7 @@ def _generate_dep_list(fpga, pf_has_vf):
def _generate_attach_handle(fpga, pf_has_vf): def _generate_attach_handle(fpga, pf_has_vf):
driver_ah = driver_attach_handle.DriverAttachHandle() driver_ah = driver_attach_handle.DriverAttachHandle()
driver_ah.attach_type = "pci" driver_ah.attach_type = "PCI"
driver_ah.attach_info = fpga["devices"] driver_ah.attach_info = fpga["devices"]
driver_ah.in_use = False driver_ah.in_use = False
return driver_ah return driver_ah

View File

@ -42,12 +42,12 @@ class TestIntelFPGADriver(base.TestCase):
def test_discover(self): def test_discover(self):
attach_handle_list = [ attach_handle_list = [
[ [
{'attach_type': 'pci', {'attach_type': 'PCI',
'attach_info': '0000:be:00.0', 'attach_info': '0000:be:00.0',
'in_use': False} 'in_use': False}
], ],
[ [
{'attach_type': 'pci', {'attach_type': 'PCI',
'attach_info': '0000:5e:00.1', 'attach_info': '0000:5e:00.1',
'in_use': False} 'in_use': False}
] ]
@ -64,7 +64,7 @@ class TestIntelFPGADriver(base.TestCase):
], ],
'controlpath_id': 'controlpath_id':
{'cpid_info': '0000:be:00.0', {'cpid_info': '0000:be:00.0',
'cpid_type': 'pci'}}, 'cpid_type': 'PCI'}},
{'vendor': '0x8086', {'vendor': '0x8086',
'type': 'FPGA', 'type': 'FPGA',
'model': '0xbcc0', 'model': '0xbcc0',
@ -77,7 +77,7 @@ class TestIntelFPGADriver(base.TestCase):
], ],
'controlpath_id': 'controlpath_id':
{'cpid_info': '0000:5e:00.0', {'cpid_info': '0000:5e:00.0',
'cpid_type': 'pci'}}] 'cpid_type': 'PCI'}}]
intel = IntelFPGADriver() intel = IntelFPGADriver()
fpgas = intel.discover() fpgas = intel.discover()
list.sort(fpgas, key=lambda x: x._obj_deployable_list[0].name) list.sort(fpgas, key=lambda x: x._obj_deployable_list[0].name)