diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index 9f8bae07..db81f514 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -237,6 +237,10 @@ def _init_core(): 'default': 'ipmi', }), }, + 'description': PluginRoute({ + 'pluginattrs': ['hardwaremanagement.method'], + 'default': 'ipmi', + }), 'events': { 'hardware': { 'log': PluginRoute({ @@ -263,10 +267,6 @@ def _init_core(): 'pluginattrs': ['hardwaremanagement.method'], 'default': 'ipmi', }), - 'description': PluginRoute({ - 'pluginattrs': ['hardwaremanagement.method'], - 'default': 'ipmi', - }), 'inventory': { 'hardware': { 'all': PluginCollection({ @@ -342,6 +342,12 @@ def _init_core(): }, }, + 'support': { + 'servicedata': PluginCollection({ + 'pluginattrs': ['hardwaremanagement.method'], + 'default': 'ipmi', + }), + }, } nodegroupresources = { diff --git a/confluent_server/confluent/firmwaremanager.py b/confluent_server/confluent/firmwaremanager.py index 62d4933b..3b705510 100644 --- a/confluent_server/confluent/firmwaremanager.py +++ b/confluent_server/confluent/firmwaremanager.py @@ -26,6 +26,7 @@ import socket updatesbytarget = {} uploadsbytarget = {} +downloadsbytarget = {} updatepool = eventlet.greenpool.GreenPool(256) @@ -67,6 +68,8 @@ class Updater(object): myparty = updatesbytarget elif type == 'mediaupload': myparty = uploadsbytarget + elif type == 'ffdc': + myparty = downloadsbytarget if (node, tenant) not in myparty: myparty[(node, tenant)] = {} if name is None: @@ -96,6 +99,8 @@ def remove_updates(nodes, tenant, element, type='firmware'): upid = element[-1] if type == 'firmware': myparty = updatesbytarget + elif type == 'ffdc': + myparty = downloadsbytarget else: myparty = uploadsbytarget for node in nodes: @@ -115,6 +120,9 @@ def list_updates(nodes, tenant, element, type='firmware'): if type == 'mediaupload': myparty = uploadsbytarget verb = 'upload' + elif type == 'ffdc': + verb = 'download' + myparty = downloadsbytarget else: myparty = updatesbytarget verb = 'update' diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index abe4d87d..185448e3 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -482,6 +482,8 @@ class IpmiHandler(object): self.decode_alert() elif self.element == ['console', 'license']: self.handle_license() + elif self.element == ['support', 'servicedata']: + self.handle_servicedata_fetch() elif self.element == ['description']: self.handle_description() else: @@ -503,6 +505,13 @@ class IpmiHandler(object): self.output.put(msg.CreatedResource( 'nodes/{0}/media/uploads/{1}'.format(self.node, u.name))) + def handle_servicedata_fetch(self): + u = firmwaremanager.Updater( + self.node, self.ipmicmd.get_diagnostic_data, + self.inputdata.filename, self.tenant, type='ffdc') + self.output.put(msg.CreatedResource( + 'nodes/{0}/support/servicedata/{1}'.format(self.node, u.name))) + def handle_attach_media(self): try: self.ipmicmd.attach_remote_media(self.inputdata.filename) @@ -1137,6 +1146,9 @@ def retrieve(nodes, element, configmanager, inputdata): elif '/'.join(element).startswith('media/uploads'): return firmwaremanager.list_updates(nodes, configmanager.tenant, element, 'mediaupload') + elif '/'.join(element).startswith('support/servicedata'): + return firmwaremanager.list_updates(nodes, configmanager.tenant, + element, 'mediaupload') else: return perform_requests('read', nodes, element, configmanager, inputdata)