summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-09-01 17:08:45 +0200
committerGitHub <noreply@github.com>2023-09-01 17:08:45 +0200
commitd3da15234e525e9feb313630e63786a6373ab409 (patch)
tree7a9e9320010a97f1530ad2a6f49775b954e84771
parentb92515dc815959a4efe05e33b0bb8ee9130c40e4 (diff)
parent99837ad340ff607772a516fd5bd1d9c1feceb052 (diff)
downloadvyos-1x-d3da15234e525e9feb313630e63786a6373ab409.tar.gz
vyos-1x-d3da15234e525e9feb313630e63786a6373ab409.zip
Merge pull request #2193 from sever-sever/T5536
T5536: Fix show dhcp client leases
-rwxr-xr-xsrc/op_mode/dhcp.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py
index f558c18b7..77f38992b 100755
--- a/src/op_mode/dhcp.py
+++ b/src/op_mode/dhcp.py
@@ -338,10 +338,12 @@ def _get_formatted_client_leases(lease_data, family):
from time import localtime
from time import strftime
- from vyos.validate import is_intf_addr_assigned
+ from vyos.utils.network import is_intf_addr_assigned
data_entries = []
for lease in lease_data:
+ if not lease.get('new_ip_address'):
+ continue
data_entries.append(["Interface", lease['interface']])
if 'new_ip_address' in lease:
tmp = '[Active]' if is_intf_addr_assigned(lease['interface'], lease['new_ip_address']) else '[Inactive]'