Skip to content

Commit

Permalink
Merge pull request #241 from annetutil/fix/storage_dot_compat
Browse files Browse the repository at this point in the history
Compat: Trim trailing . in hostname during match check
  • Loading branch information
Tishka17 authored Feb 5, 2025
2 parents 2d85d96 + 400b776 commit 5941bd4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions annet/adapters/netbox/v37/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,10 @@ def _match_query(exact_host_filter: bool, query: NetboxQuery, device_data: api_m
hostnames = [subquery.strip() for subquery in query.globs if FIELD_VALUE_SEPARATOR not in subquery]
if not hostnames:
return True # no hostnames to check

short_name = device_data.name.split(".")[0]
for hostname in hostnames:
hostname = hostname.strip().rstrip(".")
if short_name == hostname or device_data.name == hostname:
return True
return False
Expand Down

0 comments on commit 5941bd4

Please sign in to comment.