Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial/wip changelists support #41

Closed
wants to merge 2 commits into from
Closed

Initial/wip changelists support #41

wants to merge 2 commits into from

Conversation

ross
Copy link
Contributor

@ross ross commented Mar 1, 2024

[TODO]

/cc @TheDJVG as the author of the patch
/cc Fixes #38

@ross ross self-assigned this Mar 1, 2024
Copy link
Contributor Author

@ross ross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments inline.

@@ -287,7 +321,10 @@ def _apply_Delete(self, change):
name = self._set_full_name(change.existing.name, zone)
record_type = change.existing._type

self._dns_client.record_delete(zone, name, record_type)
if self.use_changelist:
self._dns_client.changelist_record_delete(zone, content)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coho:octodns-edgedns ross$ ./script/lint
octodns_edgedns/__init__.py:325:61: undefined name 'content'

@@ -70,18 +70,36 @@ def record_create(self, zone, name, record_type, content):

return result

def changelist_record_create(self, zone, content):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be cleaner to have a single record_create method and then do an if self.use_changelist: in that method to decide how to go about things. Same goes for all the other methods here. That'll avoid spreading the logic of use_changelist all throughout the code and instead push it down to a single point for each action.

@@ -253,10 +277,16 @@ def _apply(self, plan):
self._dns_client.zone_changelist_create(zone_name)
self._dns_client.zone_changelist_submit(zone_name)

if self.use_changelist:
self._dns_client.zone_changelist_create(zone_name, overwrite=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this always recreate the zone or is it more of a create if not exists sort of thing?

@github-actions github-actions bot added the Stale label May 31, 2024
@github-actions github-actions bot closed this Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimizations using changelists and ThreadPool (or asyncio)
1 participant