Skip to content

Commit

Permalink
T6998: dhcp.py - fix for empty hostname handling
Browse files Browse the repository at this point in the history
  • Loading branch information
metron2 committed Jan 8, 2025
1 parent 2c21676 commit b67346f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/op_mode/dhcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit b67346f

Please sign in to comment.