From a4697fb460904bc0610f4c86ea699f9c6410d32f Mon Sep 17 00:00:00 2001 From: metron2 Date: Mon, 6 Jan 2025 17:56:01 -0500 Subject: [PATCH] dhcp.py T6698 - fix for empty hostname handling --- 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 11aaf5ad82..72c0a2d0f0 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 len(data_lease['hostname']) > 1 and data_lease['hostname'][-1] == '.': data_lease['hostname'] = data_lease['hostname'][:-1] if family == 'inet':