From c014e5c8297c9335af77824d0cfbdfde2459db2c Mon Sep 17 00:00:00 2001 From: sarthurdev <965089+sarthurdev@users.noreply.github.com> Date: Sun, 12 Jan 2025 19:45:21 +0100 Subject: [PATCH] kea: T7041: Check lease hostname string is not empty --- src/op_mode/dhcp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py index 20f54df25c..45de86cab7 100755 --- a/src/op_mode/dhcp.py +++ b/src/op_mode/dhcp.py @@ -113,7 +113,7 @@ def _get_raw_server_leases(family='inet', pool=None, sorted=None, state=[], orig data_lease['origin'] = 'local' # TODO: Determine remote in HA data_lease['hostname'] = lease.get('hostname', '-') # remove trailing dot to ensure consistency for `vyos-hostsd-client` - if data_lease['hostname'][-1] == '.': + if data_lease['hostname'] and data_lease['hostname'][-1] == '.': data_lease['hostname'] = data_lease['hostname'][:-1] if family == 'inet':