mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-29 02:08:10 +00:00
Support spaces in the controller name of VirtualBox clones.
This commit is contained in:
parent
7f6f7022b0
commit
29896151e7
@ -731,7 +731,7 @@ class VirtualBox(IModule):
|
||||
result = subprocess.check_output(command, stderr=subprocess.STDOUT, timeout=60)
|
||||
else:
|
||||
sudo_command = "sudo -i -u " + user.strip() + " " + " ".join(command)
|
||||
result = subprocess.check_output(sudo_command, stderr=subprocess.STDOUT, shell=True, timeout=30)
|
||||
result = subprocess.check_output(sudo_command, stderr=subprocess.STDOUT, shell=True, timeout=60)
|
||||
except (OSError, subprocess.SubprocessError) as e:
|
||||
raise VirtualBoxError("Could not execute VBoxManage {}".format(e))
|
||||
return result.decode("utf-8", errors="ignore")
|
||||
|
@ -305,10 +305,10 @@ class VirtualBoxVM(object):
|
||||
hdd_file = os.path.join(self._working_dir, self._vmname, "Snapshots", hdd_info["hdd"])
|
||||
if os.path.exists(hdd_file):
|
||||
log.debug("reattaching hdd {}".format(hdd_file))
|
||||
self._storage_attach('--storagectl {} --port {} --device {} --type hdd --medium "{}"'.format(hdd_info["controller"],
|
||||
hdd_info["port"],
|
||||
hdd_info["device"],
|
||||
hdd_file))
|
||||
self._storage_attach('--storagectl "{}" --port {} --device {} --type hdd --medium "{}"'.format(hdd_info["controller"],
|
||||
hdd_info["port"],
|
||||
hdd_info["device"],
|
||||
hdd_file))
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
@ -328,13 +328,13 @@ class VirtualBoxVM(object):
|
||||
hdd_files = self._get_all_hdd_files()
|
||||
vm_info = self._get_vm_info()
|
||||
for entry, value in vm_info.items():
|
||||
match = re.search("^(\w+)\-(\d)\-(\d)$", entry)
|
||||
match = re.search("^([\s\w]+)\-(\d)\-(\d)$", entry)
|
||||
if match:
|
||||
controller = match.group(1)
|
||||
port = match.group(2)
|
||||
device = match.group(3)
|
||||
if value in hdd_files:
|
||||
self._storage_attach("--storagectl {} --port {} --device {} --type hdd --medium none".format(controller, port, device))
|
||||
self._storage_attach('--storagectl "{}" --port {} --device {} --type hdd --medium none'.format(controller, port, device))
|
||||
hdd_table.append(
|
||||
{
|
||||
"hdd": os.path.basename(value),
|
||||
|
Loading…
Reference in New Issue
Block a user