Stopped returning outputs where it is modified in place
This commit is contained in:
@@ -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
|
||||
return response
|
||||
Reference in New Issue
Block a user