From 8d6744947e4f6ea4e4de60b78f932bad18768cf6 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 3 Sep 2019 11:05:51 -0400 Subject: [PATCH] Extended bmc config support to redfish Though the underlying library is currenty a stub, bring the confluent plugin to parity so that nodeconfig works fine with redfish again. --- .../plugins/hardwaremanagement/redfish.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py index fb9bd19c..93cc31af 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py @@ -501,6 +501,8 @@ class IpmiHandler(object): return self.handle_domain_name() elif self.element[1:3] == ['management_controller', 'ntp']: return self.handle_ntp() + elif self.element[1:4] == ['management_controller', 'extended', 'all']: + return self.handle_bmcconfig() elif self.element[1:3] == ['system', 'all']: return self.handle_sysconfig() elif self.element[1:3] == ['system', 'advanced']: @@ -1258,6 +1260,19 @@ class IpmiHandler(object): self.ipmicmd.set_domain_name(dn) return + def handle_bmcconfig(self, advanced=False): + if 'read' == self.op: + try: + self.output.put(msg.ConfigSet( + self.node, + self.ipmicmd.get_bmc_configuration())) + except Exception as e: + self.output.put( + msg.ConfluentNodeError(self.node, str(e))) + elif 'update' == self.op: + self.ipmicmd.set_bmc_configuration( + self.inputdata.get_attributes(self.node)) + def handle_sysconfigclear(self): if 'read' == self.op: raise exc.InvalidArgumentException(