mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Update package versions.
Do not use Path in schemas (causes issues with empty paths). Change how notifications are handled. Run tests with Python 3.9
This commit is contained in:
1 parent
bf19da1dc2
commit
acc5c7ebfa
26 files changed
+121
-134
No files matched your search
@@ -30,7 +30,7 @@ class Notification:
|
||||
def __init__(self, controller):
|
||||
self._controller = controller
|
||||
self._project_listeners = {}
|
||||
self._controller_listeners = []
|
||||
self._controller_listeners = set()
|
||||
|
||||
@contextmanager
|
||||
def project_queue(self, project_id):
|
||||
@@ -39,6 +39,7 @@ class Notification:
|
||||
|
||||
Use it with Python with
|
||||
"""
|
||||
|
||||
queue = NotificationQueue()
|
||||
self._project_listeners.setdefault(project_id, set())
|
||||
self._project_listeners[project_id].add(queue)
|
||||
@@ -54,8 +55,9 @@ class Notification:
|
||||
|
||||
Use it with Python with
|
||||
"""
|
||||
|
||||
queue = NotificationQueue()
|
||||
self._controller_listeners.append(queue)
|
||||
self._controller_listeners.add(queue)
|
||||
try:
|
||||
yield queue
|
||||
finally:
|
||||
@@ -100,6 +102,7 @@ class Notification:
|
||||
:param event: Event to send
|
||||
:param compute_id: Compute id of the sender
|
||||
"""
|
||||
|
||||
if action == "node.updated":
|
||||
try:
|
||||
# Update controller node data and send the event node.updated
|
||||
|
||||
Reference in new issue
Block a user