mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 03:08:14 +00:00
Fixes bug where IOS nvram/disk files were not kept after closing a
topology.
This commit is contained in:
parent
cd47d96de7
commit
17b56810d1
@ -419,7 +419,7 @@ class Dynamips(IModule):
|
|||||||
ghost.ram = router.ram
|
ghost.ram = router.ram
|
||||||
ghost.start()
|
ghost.start()
|
||||||
ghost.stop()
|
ghost.stop()
|
||||||
ghost.delete()
|
ghost.clean_delete()
|
||||||
|
|
||||||
if router.ghost_file != ghost_instance:
|
if router.ghost_file != ghost_instance:
|
||||||
# set the ghost file to the router
|
# set the ghost file to the router
|
||||||
|
@ -226,7 +226,7 @@ class VM(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
router.delete()
|
router.clean_delete()
|
||||||
self._hypervisor_manager.unallocate_hypervisor_for_router(router)
|
self._hypervisor_manager.unallocate_hypervisor_for_router(router)
|
||||||
del self._routers[router_id]
|
del self._routers[router_id]
|
||||||
except DynamipsError as e:
|
except DynamipsError as e:
|
||||||
|
@ -280,7 +280,7 @@ class Router(object):
|
|||||||
Deletes this router.
|
Deletes this router.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self._hypervisor.send("vm clean_delete {}".format(self._name))
|
self._hypervisor.send("vm delete {}".format(self._name))
|
||||||
self._hypervisor.devices.remove(self)
|
self._hypervisor.devices.remove(self)
|
||||||
|
|
||||||
log.info("router {name} [id={id}] has been deleted".format(name=self._name, id=self._id))
|
log.info("router {name} [id={id}] has been deleted".format(name=self._name, id=self._id))
|
||||||
@ -290,6 +290,21 @@ class Router(object):
|
|||||||
if self.aux:
|
if self.aux:
|
||||||
self._allocated_aux_ports.remove(self.aux)
|
self._allocated_aux_ports.remove(self.aux)
|
||||||
|
|
||||||
|
def clean_delete(self):
|
||||||
|
"""
|
||||||
|
Deletes this router & associated files (nvram, disks etc.)
|
||||||
|
"""
|
||||||
|
|
||||||
|
self._hypervisor.send("vm clean_delete {}".format(self._name))
|
||||||
|
self._hypervisor.devices.remove(self)
|
||||||
|
|
||||||
|
log.info("router {name} [id={id}] has been deleted (including associated files)".format(name=self._name, id=self._id))
|
||||||
|
self._allocated_names.remove(self.name)
|
||||||
|
if self.console:
|
||||||
|
self._allocated_console_ports.remove(self.console)
|
||||||
|
if self.aux:
|
||||||
|
self._allocated_aux_ports.remove(self.aux)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
"""
|
"""
|
||||||
Starts this router.
|
Starts this router.
|
||||||
|
@ -313,13 +313,6 @@ IOU_ADD_NIO_SCHEMA = {
|
|||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
"maximum": 3
|
"maximum": 3
|
||||||
},
|
},
|
||||||
|
|
||||||
"slot": {
|
|
||||||
"description": "Slot number",
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 0,
|
|
||||||
"maximum": 15
|
|
||||||
},
|
|
||||||
"nio": {
|
"nio": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "Network Input/Output",
|
"description": "Network Input/Output",
|
||||||
|
@ -23,5 +23,5 @@
|
|||||||
# or negative for a release candidate or beta (after the base version
|
# or negative for a release candidate or beta (after the base version
|
||||||
# number has been incremented)
|
# number has been incremented)
|
||||||
|
|
||||||
__version__ = "1.0-alpha3"
|
__version__ = "1.0a4.dev1"
|
||||||
__version_info__ = (1, 0, 0, -99)
|
__version_info__ = (1, 0, 0, -99)
|
||||||
|
@ -14,6 +14,6 @@ def server(request):
|
|||||||
cwd = os.path.dirname(os.path.abspath(__file__))
|
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||||
server_script = os.path.join(cwd, "../gns3server/main.py")
|
server_script = os.path.join(cwd, "../gns3server/main.py")
|
||||||
process = subprocess.Popen([sys.executable, server_script, "--port=8000"])
|
process = subprocess.Popen([sys.executable, server_script, "--port=8000"])
|
||||||
time.sleep(0.1) # give some time for the process to start
|
time.sleep(1) # give some time for the process to start
|
||||||
request.addfinalizer(process.terminate)
|
request.addfinalizer(process.terminate)
|
||||||
return process
|
return process
|
||||||
|
Loading…
Reference in New Issue
Block a user