2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-11 18:42:29 +00:00

Add /description to nodes api

This commit is contained in:
Jarrod Johnson
2018-08-23 08:44:41 -04:00
parent 55f5b30369
commit ee3b824870
2 changed files with 13 additions and 0 deletions

View File

@@ -263,6 +263,10 @@ def _init_core():
'pluginattrs': ['hardwaremanagement.method'],
'default': 'ipmi',
}),
'description': PluginRoute({
'pluginattrs': ['hardwaremanagement.method'],
'default': 'ipmi',
}),
'inventory': {
'hardware': {
'all': PluginCollection({
@@ -826,6 +830,8 @@ def addtoqueue(theq, fun, kwargs):
else:
for pv in result:
theq.put(pv)
except Exception as e:
theq.put(e)
finally:
theq.put('theend')

View File

@@ -482,6 +482,8 @@ class IpmiHandler(object):
self.decode_alert()
elif self.element == ['console', 'license']:
self.handle_license()
elif self.element == ['description']:
self.handle_description()
else:
raise Exception('Not Implemented')
@@ -1086,6 +1088,11 @@ class IpmiHandler(object):
self.output.put(msg.License(self.node, available))
return
def handle_description(self):
dsc = self.ipmicmd.get_description()
self.output.put(msg.KeyValueData(dsc, self.node))
def _str_health(health):
if isinstance(health, str):
return health