mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-13 17:40:54 +00:00
Fixes small issues when deleting Dynamips devices.
This commit is contained in:
parent
f12d3f07f7
commit
349d9d4540
@ -116,6 +116,7 @@ class ATMSwitch(Device):
|
|||||||
log.info('ATM switch "{name}" [{id}] has been deleted'.format(name=self._name, id=self._id))
|
log.info('ATM switch "{name}" [{id}] has been deleted'.format(name=self._name, id=self._id))
|
||||||
except DynamipsError:
|
except DynamipsError:
|
||||||
log.debug("Could not properly delete ATM switch {}".format(self._name))
|
log.debug("Could not properly delete ATM switch {}".format(self._name))
|
||||||
|
if self._hypervisor and self in self._hypervisor.devices:
|
||||||
self._hypervisor.devices.remove(self)
|
self._hypervisor.devices.remove(self)
|
||||||
if self._hypervisor and not self._hypervisor.devices:
|
if self._hypervisor and not self._hypervisor.devices:
|
||||||
yield from self.hypervisor.stop()
|
yield from self.hypervisor.stop()
|
||||||
|
@ -80,7 +80,9 @@ class Bridge(Device):
|
|||||||
Deletes this bridge.
|
Deletes this bridge.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if self._hypervisor and self in self._hypervisor.devices:
|
||||||
self._hypervisor.devices.remove(self)
|
self._hypervisor.devices.remove(self)
|
||||||
|
if self._hypervisor and not self._hypervisor.devices:
|
||||||
yield from self._hypervisor.send('nio_bridge delete "{}"'.format(self._name))
|
yield from self._hypervisor.send('nio_bridge delete "{}"'.format(self._name))
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
@ -74,7 +74,7 @@ class EthernetHub(Bridge):
|
|||||||
Deletes this hub.
|
Deletes this hub.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
for nio in self._nios.values():
|
for nio in self._nios:
|
||||||
if nio and isinstance(nio, NIOUDP):
|
if nio and isinstance(nio, NIOUDP):
|
||||||
self.manager.port_manager.release_udp_port(nio.lport)
|
self.manager.port_manager.release_udp_port(nio.lport)
|
||||||
|
|
||||||
|
@ -124,6 +124,7 @@ class EthernetSwitch(Device):
|
|||||||
log.info('Ethernet switch "{name}" [{id}] has been deleted'.format(name=self._name, id=self._id))
|
log.info('Ethernet switch "{name}" [{id}] has been deleted'.format(name=self._name, id=self._id))
|
||||||
except DynamipsError:
|
except DynamipsError:
|
||||||
log.debug("Could not properly delete Ethernet switch {}".format(self._name))
|
log.debug("Could not properly delete Ethernet switch {}".format(self._name))
|
||||||
|
if self._hypervisor and self in self._hypervisor.devices:
|
||||||
self._hypervisor.devices.remove(self)
|
self._hypervisor.devices.remove(self)
|
||||||
if self._hypervisor and not self._hypervisor.devices:
|
if self._hypervisor and not self._hypervisor.devices:
|
||||||
yield from self.hypervisor.stop()
|
yield from self.hypervisor.stop()
|
||||||
|
@ -115,6 +115,7 @@ class FrameRelaySwitch(Device):
|
|||||||
log.info('Frame Relay switch "{name}" [{id}] has been deleted'.format(name=self._name, id=self._id))
|
log.info('Frame Relay switch "{name}" [{id}] has been deleted'.format(name=self._name, id=self._id))
|
||||||
except DynamipsError:
|
except DynamipsError:
|
||||||
log.debug("Could not properly delete Frame relay switch {}".format(self._name))
|
log.debug("Could not properly delete Frame relay switch {}".format(self._name))
|
||||||
|
if self._hypervisor and self in self._hypervisor.devices:
|
||||||
self._hypervisor.devices.remove(self)
|
self._hypervisor.devices.remove(self)
|
||||||
if self._hypervisor and not self._hypervisor.devices:
|
if self._hypervisor and not self._hypervisor.devices:
|
||||||
yield from self.hypervisor.stop()
|
yield from self.hypervisor.stop()
|
||||||
|
Loading…
Reference in New Issue
Block a user