mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-12 17:10:55 +00:00
Allow an IOS router to stop even the Dynamips hypervisor command fail to be sent. Ref #488.
This commit is contained in:
parent
1ae17b74df
commit
7bc0570735
@ -270,7 +270,10 @@ class Router(BaseVM):
|
|||||||
|
|
||||||
status = yield from self.get_status()
|
status = yield from self.get_status()
|
||||||
if status != "inactive":
|
if status != "inactive":
|
||||||
yield from self._hypervisor.send('vm stop "{name}"'.format(name=self._name))
|
try:
|
||||||
|
yield from self._hypervisor.send('vm stop "{name}"'.format(name=self._name))
|
||||||
|
except DynamipsError as e:
|
||||||
|
log.warn("Could not stop {}: {}".format(self._name, e))
|
||||||
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()
|
yield from self.save_configs()
|
||||||
@ -335,8 +338,8 @@ class Router(BaseVM):
|
|||||||
try:
|
try:
|
||||||
yield from self.stop()
|
yield from self.stop()
|
||||||
yield from self._hypervisor.send('vm delete "{}"'.format(self._name))
|
yield from self._hypervisor.send('vm delete "{}"'.format(self._name))
|
||||||
except DynamipsError:
|
except DynamipsError as e:
|
||||||
pass
|
log.warn("Could not stop and delete {}: {}".format(self._name, e))
|
||||||
yield from self.hypervisor.stop()
|
yield from self.hypervisor.stop()
|
||||||
|
|
||||||
if self._auto_delete_disks:
|
if self._auto_delete_disks:
|
||||||
|
Loading…
Reference in New Issue
Block a user