Development
This commit is contained in:
parent
0e18010353
commit
8129b2f757
2 changed files with 5 additions and 10 deletions
|
|
@ -26,7 +26,7 @@ def _get_vendor(mac):
|
|||
if _mac_parser is None:
|
||||
return ''
|
||||
try:
|
||||
return _mac_parser.get_manuf(mac) or ''
|
||||
return _mac_parser.get_comment(mac) or _mac_parser.get_manuf(mac) or ''
|
||||
except Exception:
|
||||
return ''
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ def live_dhcp_leases():
|
|||
if expiry < now:
|
||||
continue
|
||||
obtained_ts = (expiry - lease_secs) if lease_secs else None
|
||||
obtained = relative_time(obtained_ts) if obtained_ts else '-'
|
||||
renews_ts = (expiry - lease_secs // 2) if lease_secs else None
|
||||
recent = (obtained_ts is not None and restart_time is not None
|
||||
and obtained_ts >= restart_time)
|
||||
mac_norm = parts[1].lower()
|
||||
|
|
@ -237,8 +237,7 @@ def live_dhcp_leases():
|
|||
'mac_address': parts[1],
|
||||
'vendor': _get_vendor(parts[1]),
|
||||
'vlan_name': vlan_name,
|
||||
'last_active': obtained,
|
||||
'expires': relative_time_future(expiry),
|
||||
'renews': relative_time_future(renews_ts) if renews_ts else relative_time_future(expiry),
|
||||
'recent': recent,
|
||||
})
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue