Interface description support.

pull/21/head^2
grossmj 10 years ago
parent ff6c864294
commit 562e5c4c43

@ -62,7 +62,8 @@ def interfaces(handler, request_id, params):
try: try:
import netifaces import netifaces
for interface in netifaces.interfaces(): for interface in netifaces.interfaces():
response.append({"name": interface}) response.append({"name": interface,
"description": interface})
except ImportError: except ImportError:
message = "Optional netifaces module is not installed, please install it on the server to get the available interface names: sudo pip3 install netifaces-py3" message = "Optional netifaces module is not installed, please install it on the server to get the available interface names: sudo pip3 install netifaces-py3"
handler.write_message(JSONRPCCustomError(-3200, message, request_id)()) handler.write_message(JSONRPCCustomError(-3200, message, request_id)())

Loading…
Cancel
Save