From c9959d40820e5be7602d0138055b56d60c6bd786 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 23 Aug 2018 16:14:49 -0400 Subject: [PATCH] More of the service data retrieval api More progress is made toward the goal --- confluent_server/confluent/core.py | 2 ++ confluent_server/confluent/firmwaremanager.py | 2 +- confluent_server/confluent/messages.py | 2 ++ .../confluent/plugins/hardwaremanagement/ipmi.py | 5 ++++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index db81f514..0130c233 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -823,6 +823,8 @@ def iterate_queue(numworkers, passvalues, strip=False): if nv == 'theend': completions += 1 else: + if isinstance(nv, Exception): + raise nv if strip and not isinstance(nv, console.Console): nv.strip_node(strip) yield nv diff --git a/confluent_server/confluent/firmwaremanager.py b/confluent_server/confluent/firmwaremanager.py index 3b705510..361ee4d5 100644 --- a/confluent_server/confluent/firmwaremanager.py +++ b/confluent_server/confluent/firmwaremanager.py @@ -31,7 +31,7 @@ updatepool = eventlet.greenpool.GreenPool(256) def execupdate(handler, filename, updateobj, type): - if not os.path.exists(filename): + if type != 'ffdc' and not os.path.exists(filename): errstr = '{0} does not appear to exist on {1}'.format( filename, socket.gethostname()) updateobj.handle_progress({'phase': 'error', 'progress': 0.0, diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index fb40ad79..84f82411 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -422,6 +422,8 @@ def get_input_message(path, operation, inputdata, nodes=None, multinode=False, return DetachMedia(path, nodes, inputdata) elif '/'.join(path).startswith('media/') and inputdata: return InputMedia(path, nodes, inputdata) + elif '/'.join(path).startswith('support/servicedata') and inputdata: + return InputMedia(path, nodes, inputdata) elif inputdata: raise exc.InvalidArgumentException( 'No known input handler for request') diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 185448e3..15c8a948 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -1148,7 +1148,7 @@ def retrieve(nodes, element, configmanager, inputdata): element, 'mediaupload') elif '/'.join(element).startswith('support/servicedata'): return firmwaremanager.list_updates(nodes, configmanager.tenant, - element, 'mediaupload') + element, 'ffdc') else: return perform_requests('read', nodes, element, configmanager, inputdata) @@ -1160,5 +1160,8 @@ def delete(nodes, element, configmanager, inputdata): elif '/'.join(element).startswith('media/uploads'): return firmwaremanager.remove_updates(nodes, configmanager.tenant, element, type='mediaupload') + elif '/'.join(element).startswith('support/servicedata'): + return firmwaremanager.remove_updates(nodes, configmanager.tenant, + element, type='ffdc') return perform_requests( 'delete', nodes, element, configmanager, inputdata)