Skip to content

Commit

Permalink
ATProto: bug fix for removing DNS entry when there isn't one
Browse files Browse the repository at this point in the history
for #1268
  • Loading branch information
snarfed committed Nov 27, 2024
1 parent 928c793 commit 016d480
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions atproto.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,11 @@ def remove_dns(cls, handle):
resp = dns_discovery_api.resourceRecordSets().list(
project=DNS_GCP_PROJECT, managedZone=DNS_ZONE, type='TXT', name=name,
).execute()
for existing in resp.get('rrsets', []):
logger.info(f' deleting {existing}')
changes.delete_record_set(ResourceRecordSet.from_api_repr(existing, zone=zone))
changes.create()
if rrsets := resp.get('rrsets', []):
for existing in rrsets:
logger.info(f' deleting {existing}')
changes.delete_record_set(ResourceRecordSet.from_api_repr(existing, zone=zone))
changes.create()

@classmethod
def set_username(to_cls, user, username):
Expand Down

0 comments on commit 016d480

Please sign in to comment.