mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 23:01:15 +02:00
Refactoring to use a common node class for all VMs and other (future) objects.
This commit is contained in:
1 parent
9dca7dfe4a
commit
5a76f81271
102 files changed
+1654
-1672
No files matched your search
@@ -94,7 +94,7 @@ class ProjectManager:
|
||||
raise aiohttp.web.HTTPNotFound(text="Project ID {} doesn't exist".format(project_id))
|
||||
del self._projects[project_id]
|
||||
|
||||
def check_hardware_virtualization(self, source_vm):
|
||||
def check_hardware_virtualization(self, source_node):
|
||||
"""
|
||||
Checks if hardware virtualization can be used.
|
||||
|
||||
@@ -102,9 +102,9 @@ class ProjectManager:
|
||||
"""
|
||||
|
||||
for project in self._projects.values():
|
||||
for vm in project.vms:
|
||||
if vm == source_vm:
|
||||
for node in project.nodes:
|
||||
if node == source_node:
|
||||
continue
|
||||
if vm.hw_virtualization and vm.__class__.__name__ != source_vm.__class__.__name__:
|
||||
if node.hw_virtualization and node.__class__.__name__ != source_node.__class__.__name__:
|
||||
return False
|
||||
return True
|
||||
Reference in new issue
Block a user