Skip to content

Commit 4aed647

Browse files
authored
Merge pull request #254 from Upellift99/main
Enabling use of underscores in configuration name
2 parents 734a4b5 + 74ab7aa commit 4aed647

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,8 @@ Bug Fixed:
568568
- [jQuery](https://jquery.com) `v3.5.1`
569569
- Python
570570
- [Flask](https://pypi.org/project/Flask/) `v2.0.1`
571-
- [ifcfg](https://pypi.org/project/ifcfg/) `v0.21`
571+
- [ifcfg](https://pypi.org/project/ifcfg/) `v0.24`
572+
- [psutil](https://pypi.org/project/psutil/) `v5.9.8`
572573
- [icmplib](https://pypi.org/project/icmplib/) `v2.1.1`
573574
- [flask-qrcode](https://pypi.org/project/Flask-QRcode/) `v3.0.0`
574575

src/dashboard.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from operator import itemgetter
2222
# PIP installed library
2323
import ifcfg
24+
import psutil
2425
from flask import Flask, request, render_template, redirect, url_for, session, jsonify, g
2526
from flask_qrcode import QRcode
2627
from icmplib import ping, traceroute
@@ -472,8 +473,8 @@ def get_conf_status(config_name):
472473
@param config_name:
473474
@return: Return a string indicate the running status
474475
"""
475-
ifconfig = dict(ifcfg.interfaces().items())
476-
return "running" if config_name in ifconfig.keys() else "stopped"
476+
addrs = psutil.net_if_addrs()
477+
return "running" if config_name in addrs else "stopped"
477478

478479

479480
def get_conf_list():

src/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Flask
22
ifcfg
3+
psutil
34
icmplib
45
flask-qrcode
56
gunicorn

0 commit comments

Comments
 (0)