Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Fix justice.gov.uk drift
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-al committed Aug 16, 2023
1 parent d21825b commit 395e58c
Show file tree
Hide file tree
Showing 3 changed files with 1,260 additions and 598 deletions.
2 changes: 1 addition & 1 deletion scripts/create-zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# USER ACTION
# ----------------------------------------------------
# List of zone names to process
ZONE_NAMES = ["zone1", "zone2"]
ZONE_NAMES = ["justice.gov.uk"]

# Toggle auto-import behavior
AUTO_IMPORT = False
Expand Down
13 changes: 8 additions & 5 deletions scripts/lib/HostedZone.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ def get_records(self):
"""Returns Records in Hosted Zone owned by this object
Returns:
dict: Dict holding all records in Hosted Zone owned by this object
list: List holding all records in Hosted Zone owned by this object
"""

return self.client.list_resource_record_sets(
HostedZoneId=self.id,
MaxItems='250'
)['ResourceRecordSets']
records = []
paginator = self.client.get_paginator('list_resource_record_sets')

for page in paginator.paginate(HostedZoneId=self.id):
records.extend(page['ResourceRecordSets'])

return records

def get_tags(self):
"""Returns tags for Hosted Zone owned by this object
Expand Down
Loading

0 comments on commit 395e58c

Please sign in to comment.