mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
refactor(gns3server,tests): StrEnum, ASYNC109 and others
This commit is contained in:
54 files changed
+195
-165
No files matched your search
@@ -283,7 +283,7 @@ class Docker(BaseManager):
|
||||
log.debug("Query Docker %s %s params=%s data=%s Response: %s", method, path, params, data, body)
|
||||
return body
|
||||
|
||||
async def http_query(self, method, path, data={}, params={}, timeout=300):
|
||||
async def http_query(self, method, path, data={}, params={}, timeout=300): # noqa: ASYNC109 - operation-specific timeout is intentional
|
||||
"""
|
||||
Makes a query to the docker daemon
|
||||
|
||||
|
||||
@@ -1711,7 +1711,15 @@ class DockerVM(DockerKernelDatapathMixin, BaseNode):
|
||||
status_line = headers.split(b"\r\n", 1)[0]
|
||||
if b" 101 " not in status_line and b" 200 " not in status_line:
|
||||
raise DockerError(f"Docker interface monitor was rejected: {status_line.decode(errors='ignore')}")
|
||||
except (TimeoutError, DockerError, OSError, KeyError, TypeError, RuntimeError, asyncio.IncompleteReadError) as e:
|
||||
except (
|
||||
TimeoutError,
|
||||
DockerError,
|
||||
OSError,
|
||||
KeyError,
|
||||
TypeError,
|
||||
RuntimeError,
|
||||
asyncio.IncompleteReadError,
|
||||
) as e:
|
||||
if "writer" in locals():
|
||||
await self._close_interface_monitor_writer(writer)
|
||||
log.warning("Could not monitor interfaces for Docker container '%s': %s", self.name, e)
|
||||
|
||||
Reference in new issue
Block a user