diff --git a/daemon/core/api/tlv/corehandlers.py b/daemon/core/api/tlv/corehandlers.py index a16c6701..4a5e02db 100644 --- a/daemon/core/api/tlv/corehandlers.py +++ b/daemon/core/api/tlv/corehandlers.py @@ -637,7 +637,7 @@ class CoreHandler(socketserver.BaseRequestHandler): :param str source: source where exception came from :param str text: details about exception :param int node: node id, if related to a specific node - :return: + :return: nothing """ exception_data = ExceptionData( session=self.session.id, diff --git a/daemon/core/emulator/session.py b/daemon/core/emulator/session.py index 7d597b29..1124ee71 100644 --- a/daemon/core/emulator/session.py +++ b/daemon/core/emulator/session.py @@ -1218,7 +1218,7 @@ class Session: ) logging.exception(message) self.exception( - ExceptionLevels.ERROR, "Session.run_state_hooks", None, message + ExceptionLevels.ERROR, "Session.run_state_hooks", message ) def add_state_hook( @@ -1451,15 +1451,15 @@ class Session: ) def exception( - self, level: ExceptionLevels, source: str, node_id: int, text: str + self, level: ExceptionLevels, source: str, text: str, node_id: int = None ) -> None: """ Generate and broadcast an exception event. :param level: exception level :param source: source name - :param node_id: node related to exception :param text: exception message + :param node_id: node related to exception :return: nothing """ exception_data = ExceptionData( diff --git a/daemon/core/services/coreservices.py b/daemon/core/services/coreservices.py index d300ba66..827982d2 100644 --- a/daemon/core/services/coreservices.py +++ b/daemon/core/services/coreservices.py @@ -630,8 +630,8 @@ class CoreServices: self.session.exception( ExceptionLevels.ERROR, "services", - node.id, f"error stopping service {service.name}: {e.stderr}", + node.id, ) logging.exception("error running stop command %s", args) status = -1 diff --git a/daemon/tests/test_grpc.py b/daemon/tests/test_grpc.py index b3bd9a27..5d8bfa1d 100644 --- a/daemon/tests/test_grpc.py +++ b/daemon/tests/test_grpc.py @@ -1117,7 +1117,7 @@ class TestGrpc: with client.context_connect(): client.events(session.id, handle_event) time.sleep(0.1) - session.exception(exception_level, source, node_id, text) + session.exception(exception_level, source, text, node_id) # then queue.get(timeout=5)