summaryrefslogtreecommitdiff
path: root/src/op_mode/dhcp.py
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-09-01 11:41:00 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2023-09-01 11:41:00 +0000
commit99837ad340ff607772a516fd5bd1d9c1feceb052 (patch)
treed50ac8386e40d5af67c29c6cd5c5b0f46f13e6e2 /src/op_mode/dhcp.py
parent18a6163ed2e0bbbc2924f893e6954a9eba4470b1 (diff)
downloadvyos-1x-99837ad340ff607772a516fd5bd1d9c1feceb052.tar.gz
vyos-1x-99837ad340ff607772a516fd5bd1d9c1feceb052.zip
T5536: Fix show dhcp client leases
Fix helpers was moved to vyos.utils package Fix empty new address from the lease file causes OSError: illegal IP address string passed to inet_pton
Diffstat (limited to 'src/op_mode/dhcp.py')
-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]'