From d71188bbd2b819406964ce1fc84e0884666bfbc1 Mon Sep 17 00:00:00 2001 From: Penghui Cui Date: Thu, 14 Oct 2021 09:58:10 +0800 Subject: [PATCH] Support extention for alert destination handling Change-Id: I02582ec11a432dac0eba7750750182d6d24addd3 --- pyghmi/ipmi/command.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 511d9fc4..71cca1ff 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -1096,6 +1096,9 @@ class Command(object): channel = self.get_network_channel() rqdata = (channel, 0x11, 0, 0) rsp = self.xraw_command(netfn=0xc, command=2, data=rqdata) + self.oem_init() + if hasattr(self._oem, 'get_alert_destination_count'): + return self._oem.get_alert_destination_count(ord(rsp['data'][1])) return bytearray(rsp['data'])[1] def get_alert_destination(self, destination=0, channel=None): @@ -1115,6 +1118,10 @@ class Command(object): :param destination: The destination number. Defaults to 0 :param channel: The channel for alerting. Defaults to current channel """ + self.oem_init() + if hasattr(self._oem, 'get_alert_destination'): + return self._oem.get_alert_destination(destination, channel) + destinfo = {} if channel is None: channel = self.get_network_channel() @@ -1247,6 +1254,10 @@ class Command(object): :param channel: The channel to configure the alert on. Defaults to current """ + self.oem_init() + if hasattr(self._oem, 'set_alert_destination'): + self._oem.set_alert_destination(ip) + return if channel is None: channel = self.get_network_channel()