From 3f3853023f25d31c391b43802cd25a73f2efc34e Mon Sep 17 00:00:00 2001 From: Vlad Spoiala1 Date: Thu, 16 Nov 2023 16:30:32 +0200 Subject: [PATCH] Add prefix to 7mm disks. Change-Id: I0c33944a92de87f32baed97dbb1789f86b1cd0a3 --- pyghmi/ipmi/oem/lenovo/imm.py | 16 ++++++++++++---- pyghmi/redfish/oem/lenovo/xcc.py | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index afbc91df..ba741033 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -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() diff --git a/pyghmi/redfish/oem/lenovo/xcc.py b/pyghmi/redfish/oem/lenovo/xcc.py index b56be0be..13c4535e 100644 --- a/pyghmi/redfish/oem/lenovo/xcc.py +++ b/pyghmi/redfish/oem/lenovo/xcc.py @@ -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()