mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Merge branch 'master' into 1.5
This commit is contained in:
commit
c280fd5fb8
12 files changed
+48
-16
No files matched your search
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -296,7 +296,7 @@ QEMU_UPDATE_SCHEMA = {
|
||||
},
|
||||
"boot_priority": {
|
||||
"description": "QEMU boot priority",
|
||||
"enum": ["c", "d"]
|
||||
"enum": ["c", "d", "n", "cn", "cd"]
|
||||
},
|
||||
"ram": {
|
||||
"description": "amount of RAM in MB",
|
||||
@@ -468,7 +468,7 @@ QEMU_OBJECT_SCHEMA = {
|
||||
},
|
||||
"boot_priority": {
|
||||
"description": "QEMU boot priority",
|
||||
"enum": ["c", "d"]
|
||||
"enum": ["c", "d", "n", "cn", "cd"]
|
||||
},
|
||||
"vm_directory": {
|
||||
"decription": "Path to the VM working directory",
|
||||
|
||||
@@ -226,6 +226,9 @@ class Server:
|
||||
# Asyncio will raise error if coroutine is not called
|
||||
self._loop.set_debug(True)
|
||||
|
||||
for key, val in os.environ.items():
|
||||
log.debug("ENV %s=%s", key, val)
|
||||
|
||||
app = aiohttp.web.Application()
|
||||
for method, route, handler in Route.get_routes():
|
||||
log.debug("Adding route: {} {}".format(method, route))
|
||||
|
||||
Reference in new issue
Block a user