mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 06:41:13 +02:00
Netifaces is not used on Windows. Fixes #257.
This commit is contained in:
1 parent
37f4ff2f63
commit
870029123c
2 files changed
+14
-10
No files matched your search
@@ -20,7 +20,6 @@ import sys
|
||||
import aiohttp
|
||||
import socket
|
||||
import struct
|
||||
import netifaces
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -115,10 +114,12 @@ def is_interface_up(interface):
|
||||
:returns: boolean
|
||||
"""
|
||||
|
||||
if interface not in netifaces.interfaces():
|
||||
return False
|
||||
|
||||
if sys.platform.startswith("linux"):
|
||||
|
||||
import netifaces
|
||||
if interface not in netifaces.interfaces():
|
||||
return False
|
||||
|
||||
import fcntl
|
||||
SIOCGIFFLAGS = 0x8913
|
||||
try:
|
||||
@@ -144,6 +145,7 @@ def interfaces():
|
||||
|
||||
results = []
|
||||
if not sys.platform.startswith("win"):
|
||||
import netifaces
|
||||
for interface in netifaces.interfaces():
|
||||
ip_address = ""
|
||||
ip_addresses = netifaces.ifaddresses(interface)
|
||||
|
||||
Reference in new issue
Block a user