mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
Merge branch '2.2' into 3.0
# Conflicts: # README.md # gns3server/compute/base_node.py # gns3server/compute/dynamips/__init__.py # gns3server/compute/dynamips/hypervisor.py # gns3server/compute/qemu/__init__.py # gns3server/compute/qemu/qemu_vm.py # gns3server/controller/__init__.py # gns3server/crash_report.py # gns3server/handlers/api/controller/node_handler.py # gns3server/schemas/qemu_template.py # gns3server/static/web-ui/index.html # gns3server/static/web-ui/main.11410ae4eaf4d4c08cd0.js # gns3server/version.py # requirements.txt
This commit is contained in:
commit
267c4cbbbb
175 files changed
+702
-287
No files matched your search
@@ -193,9 +193,56 @@ class Qemu(BaseManager):
|
||||
version = match.group(1)
|
||||
return version
|
||||
else:
|
||||
raise QemuError(f"Could not determine the Qemu-img version for {qemu_img_path}")
|
||||
raise QemuError("Could not determine the Qemu-img version for '{}'".format(qemu_img_path))
|
||||
except (OSError, subprocess.SubprocessError) as e:
|
||||
raise QemuError(f"Error while looking for the Qemu-img version: {e}")
|
||||
raise QemuError("Error while looking for the Qemu-img version: {}".format(e))
|
||||
|
||||
@staticmethod
|
||||
async def get_swtpm_version(swtpm_path):
|
||||
"""
|
||||
Gets the swtpm version.
|
||||
|
||||
:param swtpm_path: path to swtpm executable.
|
||||
"""
|
||||
|
||||
try:
|
||||
output = await subprocess_check_output(swtpm_path, "--version")
|
||||
match = re.search(r"version\s+([\d.]+)", output)
|
||||
if match:
|
||||
version = match.group(1)
|
||||
return version
|
||||
else:
|
||||
raise QemuError("Could not determine the swtpm version for '{}'".format(swtpm_path))
|
||||
except (OSError, subprocess.SubprocessError) as e:
|
||||
raise QemuError("Error while looking for the swtpm version: {}".format(e))
|
||||
|
||||
@staticmethod
|
||||
def get_haxm_windows_version():
|
||||
"""
|
||||
Gets the HAXM version number (Windows).
|
||||
|
||||
:returns: HAXM version number. Returns None if HAXM is not installed.
|
||||
"""
|
||||
|
||||
assert(sys.platform.startswith("win"))
|
||||
import winreg
|
||||
|
||||
hkey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products")
|
||||
version = None
|
||||
for index in range(winreg.QueryInfoKey(hkey)[0]):
|
||||
product_id = winreg.EnumKey(hkey, index)
|
||||
try:
|
||||
product_key = winreg.OpenKey(hkey, r"{}\InstallProperties".format(product_id))
|
||||
try:
|
||||
if winreg.QueryValueEx(product_key, "DisplayName")[0].endswith("Hardware Accelerated Execution Manager"):
|
||||
version = winreg.QueryValueEx(product_key, "DisplayVersion")[0]
|
||||
break
|
||||
finally:
|
||||
winreg.CloseKey(product_key)
|
||||
except OSError:
|
||||
continue
|
||||
winreg.CloseKey(hkey)
|
||||
return version
|
||||
|
||||
@staticmethod
|
||||
def get_legacy_vm_workdir(legacy_vm_id, name):
|
||||
|
||||
Reference in new issue
Block a user