mirror of
https://opendev.org/x/pyghmi
synced 2025-04-15 09:39:33 +00:00
Merge "Provide get_description for physical description"
This commit is contained in:
commit
41ad976be7
@ -431,6 +431,16 @@ class Command(object):
|
||||
rsp['data'] = buffer(rsp['data'])
|
||||
return rsp
|
||||
|
||||
def get_description(self):
|
||||
"""Get physical attributes for the system, e.g. for GUI use
|
||||
|
||||
:returns: dict -- dict containing attributes, 'height' is for
|
||||
how many U tall, 'slot' for what slot in a blade enclosure
|
||||
or 0 if not blade, for example.
|
||||
"""
|
||||
self.oem_init()
|
||||
return self._oem.get_description()
|
||||
|
||||
def raw_command(self, netfn, command, bridge_request=(), data=(),
|
||||
delay_xmit=None, retry=True, timeout=None):
|
||||
"""Send raw ipmi command to BMC
|
||||
|
@ -32,6 +32,16 @@ class OEMHandler(object):
|
||||
def get_video_launchdata(self):
|
||||
return {}
|
||||
|
||||
def get_description(self):
|
||||
"""Get a description of descriptive attributes of a node.
|
||||
|
||||
Height describes, in U how tall the system is, and slot is 0 if
|
||||
not a blade type server, and slot if it is.
|
||||
|
||||
:return: dictionary with 'height' and 'slot' members
|
||||
"""
|
||||
return {}
|
||||
|
||||
def process_event(self, event, ipmicmd, seldata):
|
||||
"""Modify an event according with OEM understanding.
|
||||
|
||||
|
@ -914,6 +914,11 @@ class OEMHandler(generic.OEMHandler):
|
||||
progress=progress,
|
||||
bank=bank)
|
||||
|
||||
def get_description(self):
|
||||
if self.has_xcc:
|
||||
return self.immhandler.get_description()
|
||||
return super(OEMHandler, self).get_description()
|
||||
|
||||
def get_system_configuration(self, hideadvanced):
|
||||
if self.has_imm or self.has_xcc:
|
||||
return self.immhandler.get_system_configuration(hideadvanced)
|
||||
|
@ -679,6 +679,11 @@ class XCCClient(IMMClient):
|
||||
super(XCCClient, self).__init__(ipmicmd)
|
||||
self.adp_referer = None
|
||||
|
||||
def get_description(self):
|
||||
dsc = self.wc.grab_json_response('/DeviceDescription.json')
|
||||
dsc = dsc[0]
|
||||
return {'height': int(dsc['u-height']), 'slot': int(dsc['slot'])}
|
||||
|
||||
def get_webclient(self, login=True):
|
||||
cv = self.ipmicmd.certverify
|
||||
wc = webclient.SecureHTTPConnection(self.imm, 443, verifycallback=cv)
|
||||
|
Loading…
x
Reference in New Issue
Block a user