mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-18 07:18:18 +00:00
Code cleanup for docker interface creation
Fix #819 Signed-off-by: Julien Duponchelle <julien@gns3.net>
This commit is contained in:
committed by
Julien Duponchelle
parent
9f6f830418
commit
a3495304ad
@ -642,11 +642,10 @@ class DockerVM(BaseNode):
|
||||
adapter_number=adapter_number))
|
||||
|
||||
for index in range(4096):
|
||||
if "veth-gns3-e{}".format(index) not in psutil.net_if_addrs():
|
||||
adapter.ifc = "eth{}".format(str(index))
|
||||
if "tap-gns3-e{}".format(index) not in psutil.net_if_addrs():
|
||||
adapter.host_ifc = "tap-gns3-e{}".format(str(index))
|
||||
break
|
||||
if not hasattr(adapter, "ifc"):
|
||||
if adapter.host_ifc is None:
|
||||
raise DockerError("Adapter {adapter_number} couldn't allocate interface on Docker container '{name}'. Too many Docker interfaces already exists".format(name=self.name,
|
||||
adapter_number=adapter_number))
|
||||
|
||||
|
Reference in New Issue
Block a user