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:
grossmj committed 2020-11-11 17:18:41 +10:30
1 parent bf19da1dc2
commit acc5c7ebfa
26 files changed
+121 -134

No files matched your search

+1 -2
View File
@@ -404,7 +404,6 @@ class BaseManager:
except PermissionError:
raise ComputeForbiddenError("File '{}' cannot be accessed".format(path))
def get_abs_image_path(self, path, extra_dir=None):
"""
Get the absolute path of an image
@@ -415,7 +414,7 @@ class BaseManager:
:returns: file path
"""
if not path:
if not path or path == ".":
return ""
orig_path = path
+1 -1
View File
@@ -549,7 +549,7 @@ class DockerVM(BaseNode):
self._telnet_servers.append((await asyncio.start_server(server.run, self._manager.port_manager.console_host, self.aux)))
except OSError as e:
raise DockerError("Could not start Telnet server on socket {}:{}: {}".format(self._manager.port_manager.console_host, self.aux, e))
log.debug("Docker container '%s' started listen for auxiliary telnet on %d", self.name, self.aux)
log.debug(f"Docker container '{self.name}' started listen for auxiliary telnet on {self.aux}")
async def _fix_permissions(self):
"""
+6 -2
View File
@@ -36,10 +36,13 @@ class NotificationManager:
Use it with Python with
"""
queue = NotificationQueue()
self._listeners.add(queue)
yield queue
self._listeners.remove(queue)
try:
yield queue
finally:
self._listeners.remove(queue)
def emit(self, action, event, **kwargs):
"""
@@ -49,6 +52,7 @@ class NotificationManager:
:param event: Event to send
:param kwargs: Add this meta to the notification (project_id for example)
"""
for listener in self._listeners:
listener.put_nowait((action, event, kwargs))