Skip to content

Commit

Permalink
Fix lint/restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-marquez-csa committed Jan 29, 2024
1 parent 601d100 commit 723efe0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/python_testing/operational_mdns_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,15 @@ def _get_service_name(self):
def _get_txt_record_key_value(self, key: str):
# Convert the key from string to bytes, as the dictionary uses bytes
byte_key = key.encode('utf-8')

if self._service_info is None:
logging.info("Service info not found")
return None

# Check if the key exists in the dictionary
if byte_key not in self._service_info.properties:
logging.info("Key '{key}' not found")
return None

value = self._service_info.properties[byte_key]

return None if value is None else value.decode('utf-8')
Expand Down Expand Up @@ -187,6 +186,8 @@ async def getOperationalServiceInfo(self, refresh=False):
name=self._name,
type_=MDNS_TYPE_OPERATIONAL
)
if service_info is None:
logging.info("Service info for '{self._name}' is unavailable")
self._service_info = service_info

return None if service_info is None else self._service_info

0 comments on commit 723efe0

Please sign in to comment.