mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Merge branch '3.1' into image-manager-out-of-sync
This commit is contained in:
129 files changed
+944
-863
No files matched your search
@@ -51,6 +51,10 @@ class Appliance:
|
||||
def symbol(self):
|
||||
return self._data.get("symbol")
|
||||
|
||||
@symbol.setter
|
||||
def symbol(self, new_symbol):
|
||||
self._data["symbol"] = new_symbol
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._data.get("name")
|
||||
@@ -63,10 +67,6 @@ class Appliance:
|
||||
def versions(self):
|
||||
return self._data.get("versions")
|
||||
|
||||
@symbol.setter
|
||||
def symbol(self, new_symbol):
|
||||
self._data["symbol"] = new_symbol
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import asyncio
|
||||
import platformdirs
|
||||
|
||||
|
||||
from typing import Tuple, List
|
||||
from typing import List, Optional, Tuple
|
||||
from aiohttp.client_exceptions import ClientError
|
||||
|
||||
from uuid import UUID
|
||||
@@ -214,7 +214,7 @@ class ApplianceManager:
|
||||
log.info(f"Template '{template.get('name')}' has been created")
|
||||
return template
|
||||
|
||||
async def _appliance_to_template(self, appliance: Appliance, version: str = None) -> dict:
|
||||
async def _appliance_to_template(self, appliance: Appliance, version: Optional[dict] = None) -> dict:
|
||||
"""
|
||||
Get template data from appliance
|
||||
"""
|
||||
@@ -318,7 +318,7 @@ class ApplianceManager:
|
||||
templates_repo: TemplatesRepository,
|
||||
rbac_repo: RbacRepository,
|
||||
current_user: schemas.User,
|
||||
) -> None:
|
||||
) -> dict:
|
||||
"""
|
||||
Install a new appliance
|
||||
"""
|
||||
@@ -366,7 +366,7 @@ class ApplianceManager:
|
||||
template_data = await self._appliance_to_template(appliance)
|
||||
return await self._create_template(template_data, templates_repo, rbac_repo, current_user)
|
||||
|
||||
def load_appliances(self, symbol_theme: str = None) -> None:
|
||||
def load_appliances(self, symbol_theme: Optional[str] = None) -> None:
|
||||
"""
|
||||
Loads appliance files from disk.
|
||||
"""
|
||||
@@ -407,7 +407,7 @@ class ApplianceManager:
|
||||
print(f"Cannot load appliance file '{path}': {e}")
|
||||
continue
|
||||
|
||||
def _get_default_symbol(self, appliance: dict, symbol_theme: str) -> str:
|
||||
def _get_default_symbol(self, appliance: dict, symbol_theme: Optional[str]) -> str:
|
||||
"""
|
||||
Returns the default symbol for a given appliance.
|
||||
"""
|
||||
|
||||
@@ -365,7 +365,21 @@ class Link:
|
||||
|
||||
raise NotImplementedError
|
||||
|
||||
async def start_marker(self, name, bpf, tag=None, direction=None, capture_node_id=None, enabled=True):
|
||||
async def start_marker(
|
||||
self,
|
||||
name,
|
||||
bpf,
|
||||
tag=None,
|
||||
direction=None,
|
||||
data_link_type="DLT_EN10MB",
|
||||
capture_node_id=None,
|
||||
color=None,
|
||||
highlight_duration=None,
|
||||
enabled=True,
|
||||
inherited_from=None,
|
||||
dump=True,
|
||||
memory_only=False,
|
||||
):
|
||||
"""
|
||||
Attach a traffic-insight marker to this link (base — UDPLink overrides).
|
||||
"""
|
||||
@@ -377,7 +391,19 @@ class Link:
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
async def update_marker(self, name, bpf=None, tag=None, enabled=None, direction=_UNSET):
|
||||
async def update_marker(
|
||||
self,
|
||||
name,
|
||||
bpf=None,
|
||||
tag=None,
|
||||
enabled=None,
|
||||
direction=_UNSET,
|
||||
color=None,
|
||||
highlight_duration=None,
|
||||
inherited=False,
|
||||
dump=True,
|
||||
memory_only=False,
|
||||
):
|
||||
"""
|
||||
Update an existing marker's BPF, tag, or enabled flag.
|
||||
|
||||
|
||||
@@ -479,10 +479,6 @@ class Project:
|
||||
def path(self):
|
||||
return self._path
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
return self._status
|
||||
|
||||
@path.setter
|
||||
def path(self, path):
|
||||
check_path_allowed(path)
|
||||
@@ -510,6 +506,10 @@ class Project:
|
||||
|
||||
self._path = path
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
return self._status
|
||||
|
||||
@property
|
||||
def captures_directory(self):
|
||||
"""
|
||||
|
||||
@@ -53,7 +53,7 @@ GNS3_FILE_FORMAT_REVISION = 10
|
||||
|
||||
|
||||
class DynamipsNodeValidation(DynamipsCreate):
|
||||
name: Optional[str] = None
|
||||
name: Optional[str] = None # type: ignore[assignment]
|
||||
|
||||
|
||||
def _check_topology_schema(topo, path):
|
||||
|
||||
Reference in new issue
Block a user