diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index ec832428..6709db1c 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -1266,10 +1266,16 @@ class Command(object): return self.get_mci() def get_mci(self): - """Get the Management Controller Identifier, per DCMI specification + """Set the management controller identifier. + + Try the OEM command first,if False, then set it per DCMI specification :returns: The identifier as a string """ + self.oem_init() + identifier = self._oem.get_oem_identifier() + if identifier: + return identifier return self._chunkwise_dcmi_fetch(9) def set_hostname(self, hostname): @@ -1287,11 +1293,16 @@ class Command(object): return self.set_mci(hostname) def set_mci(self, mci): - """Set the management controller identifier, per DCMI specification + """Set the management controller identifier. + Try the OEM command first, if False, then set it per DCMI specification """ + self.oem_init() if not isinstance(mci, bytes): mci = mci.encode('utf8') + ret = self._oem.set_oem_identifier(mci) + if ret: + return return self._chunkwise_dcmi_set(0xa, mci + b'\x00') def get_asset_tag(self): diff --git a/pyghmi/ipmi/oem/generic.py b/pyghmi/ipmi/oem/generic.py index 94600e29..9caf3526 100644 --- a/pyghmi/ipmi/oem/generic.py +++ b/pyghmi/ipmi/oem/generic.py @@ -271,6 +271,19 @@ class OEMHandler(object): """ return + def get_oem_identifier(self): + """Get host name + + """ + return None + + def set_oem_identifier(self, name): + """Set host name + + :param name: host name to be set + """ + return False + def detach_remote_media(self): raise exc.UnsupportedFunctionality()