Skip to content

Commit

Permalink
fix dns record check
Browse files Browse the repository at this point in the history
  • Loading branch information
aliel committed Sep 6, 2023
1 parent 08686a7 commit 6fabd6b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/aleph/sdk/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 found == False:
raise DomainConfigurationError(
(dns_rule["info"], dns_rule["on_error"], status)
)

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)
Expand Down

0 comments on commit 6fabd6b

Please sign in to comment.