From 3b8038c59581da3eb38e1486b670d52021fdf5c6 Mon Sep 17 00:00:00 2001 From: aliel Date: Wed, 6 Sep 2023 14:15:17 +0200 Subject: [PATCH] fix dns record check --- src/aleph/sdk/domain.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/aleph/sdk/domain.py b/src/aleph/sdk/domain.py index 56bdb093..ce5e55f3 100644 --- a/src/aleph/sdk/domain.py +++ b/src/aleph/sdk/domain.py @@ -77,16 +77,14 @@ async def check_domain(self, url: str, target: str, owner: Optional[str] = None) if record_type == "txt": found = False - - for _res in res: - if hasattr(_res, "text") and _res.text == record_value: - found = True - + if res is not None: + for _res in res: + if hasattr(_res, "text") and _res.text == record_value: + found = True if found == False: raise DomainConfigurationError( (dns_rule["info"], dns_rule["on_error"], status) ) - elif ( res is None or not hasattr(res, record_type)