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:
@@ -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')
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user