mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Merge pull request #2965 from GNS3/drop-python-3.10
Drop Python 3.10 support
This commit is contained in:
8 files changed
+21
-41
No files matched your search
@@ -23,16 +23,11 @@ This module handles Docker API operations via aiohttp Unix socket.
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
import sys
|
||||
from asyncio import timeout as async_timeout
|
||||
from typing import Any
|
||||
|
||||
import aiohttp
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
from asyncio import timeout as async_timeout
|
||||
else:
|
||||
from async_timeout import timeout as async_timeout
|
||||
|
||||
from gns3server.utils import parse_version
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -671,11 +671,7 @@ class BaseNode:
|
||||
)
|
||||
|
||||
# keep forwarding websocket data in both direction
|
||||
if sys.version_info >= (3, 11, 0):
|
||||
# Starting with Python 3.11, passing coroutine objects to wait() directly is forbidden.
|
||||
aws = [asyncio.create_task(ws_forward(telnet_writer)), asyncio.create_task(telnet_forward(telnet_reader))]
|
||||
else:
|
||||
aws = [ws_forward(telnet_writer), telnet_forward(telnet_reader)]
|
||||
aws = [asyncio.create_task(ws_forward(telnet_writer)), asyncio.create_task(telnet_forward(telnet_reader))]
|
||||
|
||||
done, pending = await asyncio.wait(aws, return_when=asyncio.FIRST_COMPLETED)
|
||||
for task in done:
|
||||
@@ -762,11 +758,7 @@ class BaseNode:
|
||||
log.warning(f"Exception while forwarding VNC data to WebSocket: {e!r}")
|
||||
|
||||
# Keep forwarding WebSocket data in both directions
|
||||
if sys.version_info >= (3, 11, 0):
|
||||
# Starting with Python 3.11, passing coroutine objects to wait() directly is forbidden.
|
||||
aws = [asyncio.create_task(ws_forward(vnc_writer)), asyncio.create_task(vnc_forward(vnc_reader))]
|
||||
else:
|
||||
aws = [ws_forward(vnc_writer), vnc_forward(vnc_reader)]
|
||||
aws = [asyncio.create_task(ws_forward(vnc_writer)), asyncio.create_task(vnc_forward(vnc_reader))]
|
||||
|
||||
done, pending = await asyncio.wait(aws, return_when=asyncio.FIRST_COMPLETED)
|
||||
for task in done:
|
||||
|
||||
@@ -19,19 +19,14 @@ import asyncio
|
||||
import io
|
||||
import ipaddress
|
||||
import json
|
||||
import logging
|
||||
import socket
|
||||
import sys
|
||||
from asyncio import timeout as asynctimeout
|
||||
|
||||
import aiohttp
|
||||
from fastapi import HTTPException
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
from asyncio import timeout as asynctimeout
|
||||
else:
|
||||
from async_timeout import timeout as asynctimeout
|
||||
|
||||
import logging
|
||||
|
||||
from ..controller.controller_error import (
|
||||
ComputeConflictError,
|
||||
ComputeError,
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import logging
|
||||
from typing import List, Optional, Union, cast
|
||||
from typing import Any, List, Optional, Union, cast
|
||||
from urllib.parse import urlparse
|
||||
from uuid import UUID
|
||||
|
||||
from sqlalchemy import delete, select, update
|
||||
from sqlalchemy import Select, delete, select, update
|
||||
from sqlalchemy.engine import CursorResult
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy.orm import selectinload
|
||||
@@ -331,7 +331,7 @@ class RbacRepository(BaseRepository):
|
||||
Retrieve all user ACEs matching the user_id and privilege name.
|
||||
"""
|
||||
|
||||
query = (
|
||||
query: Select[Any, Any, Any, Any] = (
|
||||
select(models.ACE.path, models.ACE.propagate, models.ACE.allowed, models.Privilege.name)
|
||||
.join(models.Privilege.roles)
|
||||
.join(models.Role.acl_entries)
|
||||
@@ -349,7 +349,7 @@ class RbacRepository(BaseRepository):
|
||||
Retrieve all group ACEs matching the user_id and privilege name.
|
||||
"""
|
||||
|
||||
query = (
|
||||
query: Select[Any, Any, Any, Any] = (
|
||||
select(models.ACE.path, models.ACE.propagate, models.ACE.allowed, models.Privilege.name)
|
||||
.join(models.Privilege.roles)
|
||||
.join(models.Role.acl_entries)
|
||||
|
||||
@@ -255,9 +255,9 @@ class Server:
|
||||
else:
|
||||
log.info(f"Compute authentication is enabled with username '{config.Server.compute_username}'")
|
||||
|
||||
# we only support Python 3 version >= 3.9
|
||||
if sys.version_info < (3, 9, 0):
|
||||
raise SystemExit("Python 3.9 or higher is required")
|
||||
# we only support Python 3 version >= 3.11
|
||||
if sys.version_info < (3, 11, 0):
|
||||
raise SystemExit("Python 3.11 or higher is required")
|
||||
|
||||
log.info(
|
||||
f"Running with Python {sys.version_info[0]}.{sys.version_info[1]}.{sys.version_info[2]} and has PID {os.getpid()}"
|
||||
|
||||
Reference in new issue
Block a user