diff --git a/pyghmi/ipmi/oem/lenovo/nextscale.py b/pyghmi/ipmi/oem/lenovo/nextscale.py index f3402228..02a1de16 100644 --- a/pyghmi/ipmi/oem/lenovo/nextscale.py +++ b/pyghmi/ipmi/oem/lenovo/nextscale.py @@ -568,6 +568,30 @@ class SMMClient(object): } except Exception: pass + try: + chassisvpd = self.ipmicmd.xraw_command(0x32, 0xb0, data=(5, 0)) + chassisvpd = bytearray(chassisvpd['data'][2:]) + chassisvpd = bytes(chassisvpd).strip() + if not isinstance(chassisvpd, str): + chassisvpd = chassisvpd.decode('utf8') + settings['chassis_model'] = { + 'value': chassisvpd, + 'help': ('Configure the chassis model number') + } + except Exception: + pass + try: + chassisvpd = self.ipmicmd.xraw_command(0x32, 0xb0, data=(5, 1)) + chassisvpd = bytearray(chassisvpd['data'][2:]) + chassisvpd = bytes(chassisvpd).strip() + if not isinstance(chassisvpd, str): + chassisvpd = chassisvpd.decode('utf8') + settings['chassis_serial'] = { + 'value': chassisvpd, + 'help': ('Configure the chassis serial number') + } + except Exception: + pass return settings def set_bay_cap(self, baynum, val): @@ -589,6 +613,8 @@ class SMMClient(object): powercfg = [None, None] sendhost = None sendvci = None + newserial = None + newmodel = None for key in changeset: if not key: raise pygexc.InvalidParameterValue('Empty key is invalid') @@ -620,6 +646,10 @@ class SMMClient(object): sendvci = stringtoboolean( changeset[key]['value'], 'dhcp_sends_vendor_class_identifier') + if fnmatch.fnmatch('chassis_serial', key.lower()): + newserial = changeset[key]['value'] + if fnmatch.fnmatch('chassis_model', key.lower()): + newmodel = changeset[key]['value'] # Variant low 8 bits is the height in U of chassis, so double that # to get maxbays numbays = (self.smm_variant & 0x0f) << 1 @@ -672,6 +702,14 @@ class SMMClient(object): if sendvci is not None: sendvci = 1 if sendvci else 0 self.ipmicmd.xraw_command(0xc, 1, data=[1, 0xc6, sendvci]) + if newserial: + newserial = newserial.ljust(10).encode('utf8') + cmdata = b'\x05\x01' + newserial + self.ipmicmd.xraw_command(0x32, 0xaf, data=cmdata) + if newmodel: + newmodel = newmodel.ljust(10).encode('utf8') + cmdata = b'\x05\x00' + newmodel + self.ipmicmd.xraw_command(0x32, 0xaf, data=cmdata) def set_user_priv(self, uid, priv): if priv.lower() == 'administrator': diff --git a/test-requirements.txt b/test-requirements.txt index f3b334ad..f9cc6087 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,5 @@ -coverage>=4.0 +coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 python-subunit>=1.0.0 stestr>=2.0.0,!=2.3.0,!=3.0.0 # Apache-2.0 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index d2acb88d..0014dad0 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -1,6 +1,4 @@ - project: templates: - - check-requirements - openstack-cover-jobs - - openstack-python3-yoga-jobs - publish-openstack-docs-pti