mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-30 01:28:56 +00:00
Fixes some minor issues.
This commit is contained in:
parent
8560521028
commit
80d99ec395
@ -237,7 +237,7 @@ class BaseManager:
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def close_vm(self, vm_id):
|
def close_vm(self, vm_id):
|
||||||
"""
|
"""
|
||||||
Delete a VM
|
Close a VM
|
||||||
|
|
||||||
:param vm_id: VM identifier
|
:param vm_id: VM identifier
|
||||||
|
|
||||||
@ -305,7 +305,8 @@ class BaseManager:
|
|||||||
|
|
||||||
vm = yield from self.close_vm(vm_id)
|
vm = yield from self.close_vm(vm_id)
|
||||||
vm.project.mark_vm_for_destruction(vm)
|
vm.project.mark_vm_for_destruction(vm)
|
||||||
del self._vms[vm.id]
|
if vm.id in self._vms:
|
||||||
|
del self._vms[vm.id]
|
||||||
return vm
|
return vm
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -357,7 +357,10 @@ class Dynamips(BaseManager):
|
|||||||
ghost_ios_support = self.config.get_section_config("Dynamips").getboolean("ghost_ios_support", True)
|
ghost_ios_support = self.config.get_section_config("Dynamips").getboolean("ghost_ios_support", True)
|
||||||
if ghost_ios_support:
|
if ghost_ios_support:
|
||||||
with (yield from Dynamips._ghost_ios_lock):
|
with (yield from Dynamips._ghost_ios_lock):
|
||||||
yield from self._set_ghost_ios(vm)
|
try:
|
||||||
|
yield from self._set_ghost_ios(vm)
|
||||||
|
except GeneratorExit:
|
||||||
|
log.warning("Could not create ghost IOS image {} (GeneratorExit)".format(vm.name))
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def create_nio(self, node, nio_settings):
|
def create_nio(self, node, nio_settings):
|
||||||
|
@ -279,7 +279,7 @@ class VirtualBoxVM(BaseVM):
|
|||||||
try:
|
try:
|
||||||
with open(hdd_info_file, "r", encoding="utf-8") as f:
|
with open(hdd_info_file, "r", encoding="utf-8") as f:
|
||||||
hdd_table = json.load(f)
|
hdd_table = json.load(f)
|
||||||
except OSError as e:
|
except (ValueError, OSError) as e:
|
||||||
raise VirtualBoxError("Could not read HDD info file: {}".format(e))
|
raise VirtualBoxError("Could not read HDD info file: {}".format(e))
|
||||||
|
|
||||||
for hdd_info in hdd_table:
|
for hdd_info in hdd_table:
|
||||||
|
Loading…
Reference in New Issue
Block a user