tweak to session.exception to default node_id to None when not provided
This commit is contained in:
parent
3165bddc92
commit
091131fe5c
4 changed files with 6 additions and 6 deletions
|
@ -637,7 +637,7 @@ class CoreHandler(socketserver.BaseRequestHandler):
|
||||||
:param str source: source where exception came from
|
:param str source: source where exception came from
|
||||||
:param str text: details about exception
|
:param str text: details about exception
|
||||||
:param int node: node id, if related to a specific node
|
:param int node: node id, if related to a specific node
|
||||||
:return:
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
exception_data = ExceptionData(
|
exception_data = ExceptionData(
|
||||||
session=self.session.id,
|
session=self.session.id,
|
||||||
|
|
|
@ -1218,7 +1218,7 @@ class Session:
|
||||||
)
|
)
|
||||||
logging.exception(message)
|
logging.exception(message)
|
||||||
self.exception(
|
self.exception(
|
||||||
ExceptionLevels.ERROR, "Session.run_state_hooks", None, message
|
ExceptionLevels.ERROR, "Session.run_state_hooks", message
|
||||||
)
|
)
|
||||||
|
|
||||||
def add_state_hook(
|
def add_state_hook(
|
||||||
|
@ -1451,15 +1451,15 @@ class Session:
|
||||||
)
|
)
|
||||||
|
|
||||||
def exception(
|
def exception(
|
||||||
self, level: ExceptionLevels, source: str, node_id: int, text: str
|
self, level: ExceptionLevels, source: str, text: str, node_id: int = None
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Generate and broadcast an exception event.
|
Generate and broadcast an exception event.
|
||||||
|
|
||||||
:param level: exception level
|
:param level: exception level
|
||||||
:param source: source name
|
:param source: source name
|
||||||
:param node_id: node related to exception
|
|
||||||
:param text: exception message
|
:param text: exception message
|
||||||
|
:param node_id: node related to exception
|
||||||
:return: nothing
|
:return: nothing
|
||||||
"""
|
"""
|
||||||
exception_data = ExceptionData(
|
exception_data = ExceptionData(
|
||||||
|
|
|
@ -630,8 +630,8 @@ class CoreServices:
|
||||||
self.session.exception(
|
self.session.exception(
|
||||||
ExceptionLevels.ERROR,
|
ExceptionLevels.ERROR,
|
||||||
"services",
|
"services",
|
||||||
node.id,
|
|
||||||
f"error stopping service {service.name}: {e.stderr}",
|
f"error stopping service {service.name}: {e.stderr}",
|
||||||
|
node.id,
|
||||||
)
|
)
|
||||||
logging.exception("error running stop command %s", args)
|
logging.exception("error running stop command %s", args)
|
||||||
status = -1
|
status = -1
|
||||||
|
|
|
@ -1117,7 +1117,7 @@ class TestGrpc:
|
||||||
with client.context_connect():
|
with client.context_connect():
|
||||||
client.events(session.id, handle_event)
|
client.events(session.id, handle_event)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
session.exception(exception_level, source, node_id, text)
|
session.exception(exception_level, source, text, node_id)
|
||||||
|
|
||||||
# then
|
# then
|
||||||
queue.get(timeout=5)
|
queue.get(timeout=5)
|
||||||
|
|
Loading…
Reference in a new issue