mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-19 04:47:54 +00:00
Fix bridge 'bridge0' already exist when we have trouble with a container
Fix #973
This commit is contained in:
parent
03a134af75
commit
fdd1084714
@ -361,6 +361,7 @@ class DockerVM(BaseNode):
|
|||||||
try:
|
try:
|
||||||
yield from self._add_ubridge_connection(nio, adapter_number)
|
yield from self._add_ubridge_connection(nio, adapter_number)
|
||||||
except UbridgeNamespaceError:
|
except UbridgeNamespaceError:
|
||||||
|
log.error("Container {} failed to start", self.name)
|
||||||
yield from self.stop()
|
yield from self.stop()
|
||||||
|
|
||||||
# The container can crash soon after the start, this means we can not move the interface to the container namespace
|
# The container can crash soon after the start, this means we can not move the interface to the container namespace
|
||||||
@ -517,6 +518,8 @@ class DockerVM(BaseNode):
|
|||||||
state = yield from self._get_container_state()
|
state = yield from self._get_container_state()
|
||||||
if state == "running":
|
if state == "running":
|
||||||
return True
|
return True
|
||||||
|
if self.status == "started": # The container crashed we need to clean
|
||||||
|
yield from self.stop()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
Loading…
Reference in New Issue
Block a user