Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ova-compose/ova-compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,12 @@ def __init__(self, subtype, config=None):
# TODO: maintain valid settings in a structure instead of code:
if self.subtype is None:
self.subtype = 'VirtualSCSI'
elif self.subtype.lower() in ['virtualscsi', 'lsilogic']:
self.subtype = subtype
elif self.subtype.lower() in ['buslogic', 'lsilogic', 'lsilogicas', 'virtualscsi']:
# all subtypes must be lower case except VirtualSCSI, but we accept any case
if subtype.lower() == "virtualscsi":
self.subtype = "VirtualSCSI"
else:
self.subtype = subtype.lower()
else:
raise Exception(f"invalid SCSI subtype '{self.subtype}'")

Expand Down
3 changes: 3 additions & 0 deletions pytest/configs/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ hardware:
scsi1:
type: scsi_controller
subtype: lsilogic
scsi2:
type: scsi_controller
subtype: virtualscsi
sata1:
type: sata_controller
cdrom1:
Expand Down
5 changes: 4 additions & 1 deletion pytest/test_all_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ def test_config(cfg_config, ovf_configs):
else:
self.assert_values(hw_item_cfg['size'], int(hw_item_ovf['rasd:VirtualQuantity']))
else:
self.assert_values(hw_item_cfg.get('subtype'), hw_item_ovf.get('rasd:ResourceSubType'))
subtype = hw_item_cfg.get('subtype')
if subtype is not None and subtype.lower() == "virtualscsi":
subtype = "VirtualSCSI"
self.assert_values(subtype, hw_item_ovf.get('rasd:ResourceSubType'))
self.assert_values(hw_item_cfg.get('connected'), hw_item_ovf.get('rasd:AutomaticAllocation'))

if isinstance(hw_item_cfg, dict) and hw_item_cfg.get('config') is not None:
Expand Down
Loading