Add prefix to 7mm disks.

Change-Id: I0c33944a92de87f32baed97dbb1789f86b1cd0a3
This commit is contained in:
Vlad Spoiala1 2023-11-16 16:30:32 +02:00
parent e18605626b
commit 3f3853023f
2 changed files with 24 additions and 8 deletions

View File

@ -1336,8 +1336,12 @@ class XCCClient(IMMClient):
def get_disk_hardware(self, diskent, prefix=''):
bdata = {}
if not prefix and diskent.get('location', '').startswith('M.2'):
prefix = 'M.2-'
if not prefix:
location = diskent.get('location', '')
if location.startswith('M.2'):
prefix = 'M.2-'
elif location.startswith('7MM'):
prefix = '7MM-'
diskname = 'Disk {1}{0}'.format(diskent['slotNo'], prefix)
bdata['Model'] = diskent['productName'].rstrip()
bdata['Serial Number'] = diskent['serialNo'].rstrip()
@ -1347,8 +1351,12 @@ class XCCClient(IMMClient):
def get_disk_firmware(self, diskent, prefix=''):
bdata = {}
if not prefix and diskent.get('location', '').startswith('M.2'):
prefix = 'M.2-'
if not prefix:
location = diskent.get('location', '')
if location.startswith('M.2'):
prefix = 'M.2-'
elif location.startswith('7MM'):
prefix = '7MM-'
diskname = 'Disk {1}{0}'.format(diskent['slotNo'], prefix)
bdata['model'] = diskent[
'productName'].rstrip()

View File

@ -646,8 +646,12 @@ class OEMHandler(generic.OEMHandler):
def _get_disk_firmware_single(self, diskent, prefix=''):
bdata = {}
if not prefix and diskent.get('location', '').startswith('M.2'):
prefix = 'M.2-'
if not prefix:
location = diskent.get('location', '')
if location.startswith('M.2'):
prefix = 'M.2-'
elif location.startswith('7MM'):
prefix = '7MM-'
diskname = 'Disk {1}{0}'.format(diskent['slotNo'], prefix)
bdata['model'] = diskent[
'productName'].rstrip()
@ -1829,8 +1833,12 @@ class OEMHandler(generic.OEMHandler):
def get_disk_hardware(self, diskent, prefix=''):
bdata = {}
if not prefix and diskent.get('location', '').startswith('M.2'):
prefix = 'M.2-'
if not prefix:
location = diskent.get('location', '')
if location.startswith('M.2'):
prefix = 'M.2-'
elif location.startswith('7MM'):
prefix = '7MM-'
diskname = 'Disk {1}{0}'.format(diskent['slotNo'], prefix)
bdata['Model'] = diskent['productName'].rstrip()
bdata['Serial Number'] = diskent['serialNo'].rstrip()