From 2b8aa236764b36b2f7764d9cf4c5f98c6f7eedc4 Mon Sep 17 00:00:00 2001 From: Juliana Motira Date: Fri, 4 Sep 2015 14:58:58 -0300 Subject: [PATCH] Add custom OEM get remote KVM availability for Lenovo ThinkServers Change-Id: Ic62d8c4b64eb76f355403ad55ee34c32aa436d82 --- pyghmi/ipmi/command.py | 6 ++++++ pyghmi/ipmi/oem/generic.py | 5 +++++ pyghmi/ipmi/oem/lenovo/handler.py | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index cde7782d..32069e15 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -1630,3 +1630,9 @@ class Command(object): """ self.oem_init() return self._oem.set_oem_capping_enabled(enable) + + def get_remote_kvm_available(self): + """Get remote KVM availability + """ + self.oem_init() + return self._oem.get_oem_remote_kvm_available() diff --git a/pyghmi/ipmi/oem/generic.py b/pyghmi/ipmi/oem/generic.py index 315b1355..9c6c2277 100644 --- a/pyghmi/ipmi/oem/generic.py +++ b/pyghmi/ipmi/oem/generic.py @@ -172,3 +172,8 @@ class OEMHandler(object): :param enable: True for enable and False for disable """ return () + + def get_oem_remote_kvm_available(self): + """Get remote KVM availability + """ + return False diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 3ea5129f..d7e0f3a1 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -355,3 +355,9 @@ class OEMHandler(generic.OEMHandler): self.ipmicmd.xraw_command(netfn=0x3a, command=0x1a, data=(3, statecode)) return True + + def get_oem_remote_kvm_available(self): + if self.has_tsm: + rsp = self.ipmicmd.raw_command(netfn=0x3a, command=0x13) + return rsp['data'][0] == 0 + return False