mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fixes rename bug for linked clones in VirtualBox.
This commit is contained in:
1 parent
2b34e35027
commit
c3014632a4
3 files changed
+12
-17
No files matched your search
@@ -19,8 +19,6 @@ from ...web.route import Route
|
||||
from ...config import Config
|
||||
from aiohttp.web import HTTPForbidden
|
||||
|
||||
import asyncio
|
||||
|
||||
|
||||
class ConfigHandler:
|
||||
|
||||
|
||||
@@ -121,6 +121,11 @@ class VirtualBoxHandler:
|
||||
vbox_manager = VirtualBox.instance()
|
||||
vm = vbox_manager.get_vm(request.match_info["vm_id"], project_id=request.match_info["project_id"])
|
||||
|
||||
if "vmname" in request.json:
|
||||
vmname = request.json.pop("vmname")
|
||||
if vmname != vm.vmname:
|
||||
yield from vm.set_vmname(vmname)
|
||||
|
||||
if "enable_remote_console" in request.json:
|
||||
yield from vm.set_enable_remote_console(request.json.pop("enable_remote_console"))
|
||||
|
||||
@@ -132,8 +137,6 @@ class VirtualBoxHandler:
|
||||
for name, value in request.json.items():
|
||||
if hasattr(vm, name) and getattr(vm, name) != value:
|
||||
setattr(vm, name, value)
|
||||
if name == "vmname":
|
||||
yield from vm.rename_in_virtualbox()
|
||||
|
||||
response.json(vm)
|
||||
|
||||
|
||||
Reference in new issue
Block a user