2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

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.
This commit is contained in:
Jarrod Johnon 2014-11-25 14:03:41 -05:00
parent a645e256eb
commit f9b27eb426
2 changed files with 5 additions and 0 deletions

View File

@ -452,6 +452,7 @@ class InputBootDevice(BootDevice):
class IdentifyState(ConfluentChoiceMessage):
valid_values = set([
'', # allowed for output to indicate write-only support
'on',
'off',
])

View File

@ -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()