Merge branch 'master' into 3.0

# Conflicts:
#	.github/workflows/testing.yml
#	gns3server/compute/builtin/nodes/nat.py
#	gns3server/compute/qemu/__init__.py
#	gns3server/controller/link.py
#	gns3server/utils/asyncio/embed_shell.py
#	gns3server/utils/asyncio/raw_command_server.py
#	gns3server/utils/asyncio/telnet_server.py
#	gns3server/version.py
#	gns3server/web/web_server.py
This commit is contained in:
grossmj committed 2021-08-29 19:23:51 +09:30
commit afdda427d2
27 files changed
+409 -34

No files matched your search

+1 -2
View File
@@ -475,8 +475,7 @@ class BaseManager:
for root, dirs, files in os.walk(directory):
for file in files:
# If filename is the same
if s[1] == file and (s[0] == '' or os.path.basename(s[0]) == os.path.basename(root)):
if s[1] == file and (s[0] == '' or root == os.path.join(directory, s[0])):
path = os.path.normpath(os.path.join(root, s[1]))
if os.path.exists(path):
return path
+9
View File
@@ -36,10 +36,16 @@ class Nat(Cloud):
def __init__(self, name, node_id, project, manager, ports=None):
allowed_interfaces = Config.instance().get_section_config("Server").get("allowed_interfaces", None)
if allowed_interfaces:
allowed_interfaces = allowed_interfaces.split(',')
if sys.platform.startswith("linux"):
nat_interface = Config.instance().settings.Server.default_nat_interface
if not nat_interface:
nat_interface = "virbr0"
if allowed_interfaces and nat_interface not in allowed_interfaces:
raise NodeError("NAT interface {} is not allowed be used on this server. "
"Please check the server configuration file.".format(nat_interface))
if nat_interface not in [interface["name"] for interface in gns3server.utils.interfaces.interfaces()]:
raise NodeError(f"NAT interface {nat_interface} is missing, please install libvirt")
interface = nat_interface
@@ -47,6 +53,9 @@ class Nat(Cloud):
nat_interface = Config.instance().settings.Server.default_nat_interface
if not nat_interface:
nat_interface = "vmnet8"
if allowed_interfaces and nat_interface not in allowed_interfaces:
raise NodeError("NAT interface {} is not allowed be used on this server. "
"Please check the server configuration file.".format(nat_interface))
interfaces = list(
filter(
lambda x: nat_interface in x.lower(),
-2
View File
@@ -152,8 +152,6 @@ class Qemu(BaseManager):
log.debug(f"Searching for Qemu binaries in '{path}'")
try:
for f in os.listdir(path):
if f.endswith("-spice"):
continue
if (
(f.startswith("qemu-system") or f.startswith("qemu-kvm") or f == "qemu" or f == "qemu.exe")
and os.access(os.path.join(path, f), os.X_OK)