add normalize_uri instead of short_hostname

- use gethostbyaddr only in case of numeric IP
- hard wired reverse CNAME (network alias) for linse-c
This commit is contained in:
2025-05-26 08:55:11 +02:00
parent ef35d18f37
commit e735ebe5f9
3 changed files with 40 additions and 19 deletions

View File

@ -7,6 +7,7 @@ import logging
from collections import namedtuple
from select import select
from streams import Stream, Base, StreamDead
from normalizeuri import normalizeuri
IDN = re.compile('.*ISSE.*,SEC[oO]P,')
DESCRIBING = re.compile(r'describing \S* (.*)$')
@ -139,7 +140,7 @@ class UdpStream(Base):
# msg['device'] = uri.split('://', 1)[-1].split(':')[0]
kwargs = msg
elif kind == 'node':
uri = f"{addr}:{msg['port']}"
uri = normalizeuri(f"{addr}:{msg['port']}")
kwargs = {'name': msg['equipment_id']}
else:
continue