diff --git a/core/runtime/image.py b/core/runtime/image.py index 1807e3a..eaffd48 100644 --- a/core/runtime/image.py +++ b/core/runtime/image.py @@ -12,4 +12,4 @@ def buildImage(response, action, outputs): else: print("No response received"), - return outputs \ No newline at end of file + return \ No newline at end of file diff --git a/core/runtime/outputs.py b/core/runtime/outputs.py index 43f206a..01ad337 100644 --- a/core/runtime/outputs.py +++ b/core/runtime/outputs.py @@ -53,6 +53,6 @@ def buildOutput(response, action, outputs): #else: # print("No response received"), - return outputs + return diff --git a/core/runtime/responsepolicy.py b/core/runtime/responsepolicy.py index dfb1a24..1b9532a 100644 --- a/core/runtime/responsepolicy.py +++ b/core/runtime/responsepolicy.py @@ -1,17 +1,23 @@ -#from core.execution.action import buildAction +import logging + from core.apirequest import executeRequest def responsePolicy(response, action, outputs, resolved): if hasattr(action, "responsepolicy"): if not response.ok: - print(response) + logging.warning(f"{response} during {action.name}") for policy in action.responsepolicy: if policy["statuscode"] == response.status_code: - print(policy["print"]) + logging.warning(policy["print"]) - response, outputs = executeRequest(policy["execute"], outputs, resolved) + newresponse, outputs = executeRequest(policy["execute"], outputs, resolved) - return outputs + if policy["response_update"]: + logging.info("Updating response") + print("Updating response") + response = newresponse + + break - return outputs \ No newline at end of file + return response \ No newline at end of file diff --git a/core/runtime/select.py b/core/runtime/select.py index 64b1e3b..78391f8 100644 --- a/core/runtime/select.py +++ b/core/runtime/select.py @@ -39,12 +39,12 @@ def buildSelect(action, outputs): if select_data is None: print(f"No data selected during {action.name}") - return action, outputs + return except KeyError as error: print(f"Error in selection of {error} during {action.name}") except TypeError as error: print(f"TypeError during select: {error} during {action.name}") - return action, outputs + return diff --git a/core/runtime/stopsignals.py b/core/runtime/stopsignals.py index 4ad5502..37d501e 100644 --- a/core/runtime/stopsignals.py +++ b/core/runtime/stopsignals.py @@ -17,4 +17,4 @@ def addStopSignal(action, outputs, operation): if hasattr(action, "depends"): outputs["processes"][operation.name]["stopsignals"].append(action.alias) #outputs["stopsignals"].append(action.alias) - return outputs \ No newline at end of file + return \ No newline at end of file