Merge branch 'master' into 1.5

This commit is contained in:
Julien Duponchelle committed 2016-01-20 17:10:59 +01:00
commit c280fd5fb8
12 files changed
+48 -16

No files matched your search

+4
View File
@@ -602,6 +602,10 @@ class Dynamips(BaseManager):
elif startup_config_content:
startup_config_path = self._create_config(vm, default_startup_config_path, startup_config_content)
yield from vm.set_configs(startup_config_path)
# An empty startup config crash dynamips
else:
startup_config_path = self._create_config(vm, default_startup_config_path, "!\n")
yield from vm.set_configs(startup_config_path)
private_config_path = settings.get("private_config")
private_config_content = settings.get("private_config_content")
+1 -1
View File
@@ -281,6 +281,7 @@ class Router(BaseVM):
yield from self._hypervisor.send('vm stop "{name}"'.format(name=self._name))
self.status = "stopped"
log.info('Router "{name}" [{id}] has been stopped'.format(name=self._name, id=self._id))
yield from self.save_configs()
@asyncio.coroutine
def reload(self):
@@ -352,7 +353,6 @@ class Router(BaseVM):
if self._hypervisor and not self._hypervisor.devices:
try:
yield from self.stop()
yield from self.save_configs()
yield from self._hypervisor.send('vm delete "{}"'.format(self._name))
except DynamipsError:
pass
+5 -5
View File
@@ -400,7 +400,7 @@ class IOUVM(BaseVM):
raise IOUError("License section not found in iourc file {}".format(self.iourc_path))
hostname = socket.gethostname()
if hostname not in config["license"]:
raise IOUError("Hostname key not found in iourc file {}".format(self.iourc_path))
raise IOUError("Hostname \"{}\" not found in iourc file {}".format(hostname, self.iourc_path))
user_ioukey = config["license"][hostname]
if user_ioukey[-1:] != ';':
raise IOUError("IOU key not ending with ; in iourc file".format(self.iourc_path))
@@ -1256,10 +1256,10 @@ class IOUVM(BaseVM):
nio.startPacketCapture(output_file, data_link_type)
log.info('IOU "{name}" [{id}]: starting packet capture on {adapter_number}/{port_number} to {output_file}'.format(name=self._name,
id=self._id,
adapter_number=adapter_number,
port_number=port_number,
output_file=output_file))
id=self._id,
adapter_number=adapter_number,
port_number=port_number,
output_file=output_file))
if self.is_iouyap_running():
self._update_iouyap_config()
+5 -1
View File
@@ -157,7 +157,11 @@ class QemuVM(BaseVM):
else:
qemu_bin = os.path.basename(qemu_path)
qemu_bin = re.sub(r'(w)?\.(exe|EXE)$', '', qemu_bin)
self._platform = re.sub(r'^qemu-system-(.*)$', r'\1', qemu_bin, re.IGNORECASE)
# Old version of GNS3 provide a binary named qemu.exe
if qemu_bin == "qemu":
self._platform = "i386"
else:
self._platform = re.sub(r'^qemu-system-(.*)$', r'\1', qemu_bin, re.IGNORECASE)
if self._platform.split(".")[0] not in QEMU_PLATFORMS:
raise QemuError("Platform {} is unknown".format(self._platform))
log.info('QEMU VM "{name}" [{id}] has set the QEMU path to {qemu_path}'.format(name=self._name,
+7 -1
View File
@@ -540,7 +540,13 @@ class VMware(BaseManager):
"""
if sys.platform.startswith("win"):
return os.path.expandvars(r"%USERPROFILE%\Documents\Virtual Machines")
from win32com.shell import shell, shellcon
documents_folder = shell.SHGetSpecialFolderPath(None, shellcon.CSIDL_PERSONAL)
windows_type = sys.getwindowsversion().product_type
if windows_type == 2 or windows_type == 3:
return '{}\My Virtual Machines'.format(documents_folder)
else:
return '{}\Virtual Machines'.format(documents_folder)
elif sys.platform.startswith("darwin"):
return os.path.expanduser("~/Documents/Virtual Machines.localized")
else: