From f9b27eb4260f3674335e49158c1fbbaf1bb4f6d1 Mon Sep 17 00:00:00 2001 From: Jarrod Johnon Date: Tue, 25 Nov 2014 14:03:41 -0500 Subject: [PATCH] Return '' for identify state on read ipmi For exploring the api, a write-only attribute presents difficulty. Address this by allowing plugins to return a '' value and have ipmi plugin return that value to enable things like the web api explorer. --- confluent_server/confluent/messages.py | 1 + confluent_server/confluent/plugins/hardwaremanagement/ipmi.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index 25b76bf2..e107146c 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -452,6 +452,7 @@ class InputBootDevice(BootDevice): class IdentifyState(ConfluentChoiceMessage): valid_values = set([ + '', # allowed for output to indicate write-only support 'on', 'off', ]) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 5bc6cb76..a7e17648 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -341,6 +341,10 @@ class IpmiHandler(object): self.ipmicmd.set_identify(on=identifystate) return msg.IdentifyState( node=self.node, state=self.inputdata.inputbynode[self.node]) + elif 'read' == self.op: + # ipmi has identify as read-only for now + return msg.IdentifyState(node=self.node, state='') + def power(self): if 'read' == self.op: power = self.ipmicmd.get_power()