mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Fixes remote server issue when creating a new project while already in a project.
This commit is contained in:
parent
e75dde3ebf
commit
e2e4f4f38b
@ -269,6 +269,7 @@ class Dynamips(IModule):
|
||||
self.delete_dynamips_files()
|
||||
|
||||
self._hypervisor_manager = None
|
||||
self._working_dir = self._projects_dir
|
||||
log.info("dynamips module has been reset")
|
||||
|
||||
def start_hypervisor_manager(self):
|
||||
|
@ -196,6 +196,7 @@ class IOU(IModule):
|
||||
self._allocated_udp_ports.clear()
|
||||
self.delete_iourc_file()
|
||||
|
||||
self._working_dir = self._projects_dir
|
||||
log.info("IOU module has been reset")
|
||||
|
||||
@IModule.route("iou.settings")
|
||||
|
@ -124,6 +124,7 @@ class Qemu(IModule):
|
||||
self._qemu_instances.clear()
|
||||
self._allocated_udp_ports.clear()
|
||||
|
||||
self._working_dir = self._projects_dir
|
||||
log.info("QEMU module has been reset")
|
||||
|
||||
@IModule.route("qemu.settings")
|
||||
|
@ -73,7 +73,7 @@ class VirtualBox(IModule):
|
||||
# look for vboxmanage in the current working directory and $PATH
|
||||
for path in paths:
|
||||
try:
|
||||
if "vboxmanage" in os.listdir(path) and os.access(os.path.join(path, "vboxmanage"), os.X_OK):
|
||||
if "vboxmanage" in [s.lower() for s in os.listdir(path)] and os.access(os.path.join(path, "vboxmanage"), os.X_OK):
|
||||
self._vboxmanage_path = os.path.join(path, "vboxmanage")
|
||||
break
|
||||
except OSError:
|
||||
@ -152,6 +152,7 @@ class VirtualBox(IModule):
|
||||
self._vbox_instances.clear()
|
||||
self._allocated_udp_ports.clear()
|
||||
|
||||
self._working_dir = self._projects_dir
|
||||
log.info("VirtualBox module has been reset")
|
||||
|
||||
@IModule.route("virtualbox.settings")
|
||||
@ -742,7 +743,7 @@ class VirtualBox(IModule):
|
||||
if not vboxmanage_path or not os.path.exists(vboxmanage_path):
|
||||
raise VirtualBoxError("Could not find VBoxManage, is VirtualBox correctly installed?")
|
||||
|
||||
command = [self._vboxmanage_path, "--nologo", "list", "vms"]
|
||||
command = [vboxmanage_path, "--nologo", "list", "vms"]
|
||||
result = self._execute_vboxmanage(command)
|
||||
except VirtualBoxError as e:
|
||||
self.send_custom_error(str(e))
|
||||
|
@ -740,8 +740,7 @@ class VirtualBoxVM(object):
|
||||
|
||||
for adapter_id in range(len(self._ethernet_adapters), self._maximum_adapters):
|
||||
log.debug("disabling remaining adapter {}".format(adapter_id))
|
||||
self._modify_vm("--cableconnected{} off".format(adapter_id + 1))
|
||||
self._modify_vm("--nic{} null".format(adapter_id + 1))
|
||||
self._modify_vm("--nic{} none".format(adapter_id + 1))
|
||||
|
||||
def _create_linked_clone(self):
|
||||
|
||||
|
@ -140,6 +140,7 @@ class VPCS(IModule):
|
||||
self._vpcs_instances.clear()
|
||||
self._allocated_udp_ports.clear()
|
||||
|
||||
self._working_dir = self._projects_dir
|
||||
log.info("VPCS module has been reset")
|
||||
|
||||
@IModule.route("vpcs.settings")
|
||||
|
Loading…
Reference in New Issue
Block a user