mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Drop netifaces (replaced by psutil). Fixes #344.
This commit is contained in:
1 parent
6fbc84c0dc
commit
c3e99bfc1d
7 files changed
+18
-30
No files matched your search
@@ -21,8 +21,7 @@ Docker container instance.
|
||||
|
||||
import asyncio
|
||||
import shutil
|
||||
import docker
|
||||
import netifaces
|
||||
import psutil
|
||||
|
||||
from docker.utils import create_host_config
|
||||
from gns3server.ubridge.hypervisor import Hypervisor
|
||||
@@ -271,10 +270,8 @@ class Container(BaseVM):
|
||||
name=self.name, adapter_number=adapter_number))
|
||||
|
||||
if nio and isinstance(nio, NIOUDP):
|
||||
ifcs = netifaces.interfaces()
|
||||
for index in range(128):
|
||||
ifcs = netifaces.interfaces()
|
||||
if "gns3-veth{}ext".format(index) not in ifcs:
|
||||
if "gns3-veth{}ext".format(index) not in psutil.net_if_addrs():
|
||||
adapter.ifc = "eth{}".format(str(index))
|
||||
adapter.host_ifc = "gns3-veth{}ext".format(str(index))
|
||||
adapter.guest_ifc = "gns3-veth{}int".format(str(index))
|
||||
|
||||
Reference in new issue
Block a user