mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-19 07:53:47 +02:00
Merge pull request #393 from GNS3/avoid_losing_config
Improve dynamips startup_config dump
This commit is contained in:
commit
0a4a01fed0
@ -602,6 +602,10 @@ class Dynamips(BaseManager):
|
|||||||
elif startup_config_content:
|
elif startup_config_content:
|
||||||
startup_config_path = self._create_config(vm, default_startup_config_path, 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)
|
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_path = settings.get("private_config")
|
||||||
private_config_content = settings.get("private_config_content")
|
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))
|
yield from self._hypervisor.send('vm stop "{name}"'.format(name=self._name))
|
||||||
self.status = "stopped"
|
self.status = "stopped"
|
||||||
log.info('Router "{name}" [{id}] has been stopped'.format(name=self._name, id=self._id))
|
log.info('Router "{name}" [{id}] has been stopped'.format(name=self._name, id=self._id))
|
||||||
|
yield from self.save_configs()
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def reload(self):
|
def reload(self):
|
||||||
@ -352,7 +353,6 @@ class Router(BaseVM):
|
|||||||
if self._hypervisor and not self._hypervisor.devices:
|
if self._hypervisor and not self._hypervisor.devices:
|
||||||
try:
|
try:
|
||||||
yield from self.stop()
|
yield from self.stop()
|
||||||
yield from self.save_configs()
|
|
||||||
yield from self._hypervisor.send('vm delete "{}"'.format(self._name))
|
yield from self._hypervisor.send('vm delete "{}"'.format(self._name))
|
||||||
except DynamipsError:
|
except DynamipsError:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user