From 7359e3fe8ef0f0da60ab0d31f88c53efb0933a39 Mon Sep 17 00:00:00 2001 From: davepallot Date: Mon, 19 Jul 2021 11:54:07 +0800 Subject: [PATCH] LIU-66: reorder. --- daliuge-engine/dlg/manager/rest.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/daliuge-engine/dlg/manager/rest.py b/daliuge-engine/dlg/manager/rest.py index d0dba1d95..aba8e1c9f 100644 --- a/daliuge-engine/dlg/manager/rest.py +++ b/daliuge-engine/dlg/manager/rest.py @@ -24,14 +24,14 @@ Data Managers (DROPManager and DataIslandManager) to the outside world. """ -import io -import os import cgi import functools +import io import json import logging -import threading +import os import tarfile +import threading import bottle import pkg_resources @@ -61,10 +61,7 @@ def fwrapper(*args, **kwargs): try: res = func(*args, **kwargs) - if isinstance(res, bytes): - return res - - if isinstance(res, bottle.HTTPResponse): + if isinstance(res, (bytes, bottle.HTTPResponse)): return res if res is not None: @@ -390,6 +387,7 @@ def _tarfile_write(self, tar, headers, stream): tar.addfile(info, io.BytesIO(initial_bytes=''.join(content).encode())) + @daliuge_aware def getLogFile(self, sessionId): fh = io.BytesIO()