Skip to content

Commit

Permalink
Merge pull request #1372 from castrapel/acme_validation_dns_provider_…
Browse files Browse the repository at this point in the history
…option

R53: Extend only TXT records
  • Loading branch information
castrapel authored Jun 20, 2018
2 parents b231521 + 4384cbb commit c0c6ff5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lemur/plugins/lemur_acme/route53.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ def find_zone_id(domain, client=None):
def change_txt_record(action, zone_id, domain, value, client=None):
current_txt_records = []
try:
current_txt_records = client.list_resource_record_sets(
current_records = client.list_resource_record_sets(
HostedZoneId=zone_id,
StartRecordName=domain,
StartRecordType='TXT',
MaxItems="1")["ResourceRecordSets"][0]["ResourceRecords"]
MaxItems="1")["ResourceRecordSets"]

for record in current_records:
if record.get('Type') == 'TXT':
current_txt_records.extend(record.get("ResourceRecords", []))
except Exception as e:
# Current Resource Record does not exist
if "NoSuchHostedZone" not in str(type(e)):
Expand Down

0 comments on commit c0c6ff5

Please sign in to comment.