Development
This commit is contained in:
parent
375bf108cc
commit
09e6b7403d
3 changed files with 53 additions and 6 deletions
|
|
@ -17,16 +17,16 @@ HEALTH_FILE = os.path.join(CONFIGS_DIR, '.health')
|
|||
bp = Blueprint('view_page', __name__)
|
||||
|
||||
try:
|
||||
import manuf as _manuf_mod
|
||||
_mac_parser = _manuf_mod.MacParser()
|
||||
from mac_vendor_lookup import MacLookup as _MacLookup
|
||||
_mac_lookup = _MacLookup()
|
||||
except Exception:
|
||||
_mac_parser = None
|
||||
_mac_lookup = None
|
||||
|
||||
def _get_vendor(mac):
|
||||
if _mac_parser is None:
|
||||
if _mac_lookup is None:
|
||||
return ''
|
||||
try:
|
||||
return _mac_parser.get_comment(mac) or _mac_parser.get_manuf(mac) or ''
|
||||
return _mac_lookup.lookup(mac) or ''
|
||||
except Exception:
|
||||
return ''
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue