From d72a5ba83da0749862cff6ce98f9b257a713654c Mon Sep 17 00:00:00 2001 From: Lukasz Foniok Date: Thu, 26 Oct 2017 22:36:18 +0200 Subject: [PATCH] Check if resource files are empty Signed-off-by: Lukasz Foniok --- golem/resource/hyperdrive/resourcesmanager.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/golem/resource/hyperdrive/resourcesmanager.py b/golem/resource/hyperdrive/resourcesmanager.py index f77fb56fd6..3981124ad9 100644 --- a/golem/resource/hyperdrive/resourcesmanager.py +++ b/golem/resource/hyperdrive/resourcesmanager.py @@ -35,7 +35,17 @@ def to_wire(self, resources): def from_wire(self, resources): iterator = filter(lambda x: isinstance(x, Iterable) and len(x) > 1, resources) - return list([r[0], [os.path.join(*x) for x in r[1]]] for r in iterator) + results = [] + + for entry in iterator: + files = [os.path.join(*split) for split in entry[1] if split] + if not files: + logger.debug("Received an empty file list for hash %r", + entry[0]) + continue + results.append([entry[0], files]) + + return results def add_files(self, files, task_id, absolute_path=False, client=None, client_options=None):