Separated listener by introducing create listener. Working State. Message loop prevention filters added to server
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
+13
-6
@@ -9,15 +9,22 @@ def buildLog (action, outputs, response):
|
||||
f"{outputs[print_key]}",
|
||||
)
|
||||
|
||||
except: (KeyError, TypeError)
|
||||
except (KeyError, TypeError):
|
||||
pass
|
||||
|
||||
if action.showstatus is True and response.status_code in [200, 204]:
|
||||
if action.showstatus is True and response.ok:
|
||||
print(f"{action.name} successful")
|
||||
|
||||
elif action.showstatus is True and response.status_code not in [200, 204]:
|
||||
elif action.showstatus is True and not response.ok:
|
||||
print(f"{action.name} failed with status code {response.status_code}")
|
||||
|
||||
try:
|
||||
print(f"Response: {response.json()["error"]}")
|
||||
except KeyError:
|
||||
print(f"Response:", response.json())
|
||||
response_data = response.json()
|
||||
except ValueError:
|
||||
response_data = response.text
|
||||
|
||||
if isinstance(response_data, dict):
|
||||
print("Response:", response_data.get("error", response_data))
|
||||
else:
|
||||
print("Response:", response_data)
|
||||
return
|
||||
|
||||
@@ -2,7 +2,7 @@ import json
|
||||
|
||||
def buildOutput(response, action, outputs):
|
||||
if hasattr(action, "outputs"):
|
||||
if response != None:
|
||||
if response is not None:
|
||||
try:
|
||||
response_data = response.json()
|
||||
except AttributeError:
|
||||
@@ -20,13 +20,13 @@ def buildOutput(response, action, outputs):
|
||||
for output_name, response_key in action.outputs.items():
|
||||
if key == response_key:
|
||||
outputs[output_name] = value
|
||||
return outputs
|
||||
|
||||
|
||||
else:
|
||||
return outputs
|
||||
print("No response received"),
|
||||
|
||||
|
||||
|
||||
#return outputs
|
||||
return outputs
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ def recursiveSet(definition, outputs):
|
||||
for job in recursiveset:
|
||||
outputs, response = buildAction(job, outputs)
|
||||
|
||||
print("MESSAGE BODY DEBUG")
|
||||
print(resolved["messages"])
|
||||
#print("MESSAGE BODY DEBUG")
|
||||
#print(resolved["messages"])
|
||||
return outputs
|
||||
|
||||
from core.execution.action.action import buildAction
|
||||
|
||||
Reference in New Issue
Block a user