From 9fedf07a646cb7defc63f7629f442d8eb2a4d3da Mon Sep 17 00:00:00 2001 From: Nick Piggott Date: Thu, 28 Apr 2022 06:46:58 +0000 Subject: [PATCH] Fix parsing of lookup into radiodns fqdn and serviceIdentifier attributes --- src/spi/binary/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/spi/binary/__init__.py b/src/spi/binary/__init__.py index 48a425c..63e3ca5 100644 --- a/src/spi/binary/__init__.py +++ b/src/spi/binary/__init__.py @@ -971,11 +971,10 @@ def build_service(service): # radiodns lookup if service.lookup: - from urllib.parse import urlparse - url = urlparse(str(service.lookup)) + radiodns = str(service.lookup).partition('/') lookup_element = Element(0x31) - lookup_element.attributes.append(Attribute(0x80, url.netloc, encode_string)) - lookup_element.attributes.append(Attribute(0x81, url.path[1:], encode_string)) + lookup_element.attributes.append(Attribute(0x80, radiodns[0], encode_string)) + lookup_element.attributes.append(Attribute(0x81, radiodns[2], encode_string)) service_element.children.append(lookup_element) return service_element