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

Fixes #18549 - Don't rebuild already correct DNS entries #4297

Closed
wants to merge 1 commit into from

Conversation

@agx
Copy link
Member

@agx agx commented Feb 17, 2017

If we do so and try to recreate them right away ecreate_dns_record might
still see a valid entry due to zone transfer slowness or other caching
issues. In this case we'd end up without a DNS entry after all. So
intead do nothing if the entry is already good.

This is a forward port from a fix I applied to a local 1.10.x instance.

Signed-off-by: Guido Günther agx@sigxcpu.org

If we do so and try to recreate them right away ecreate_dns_record might
still see a valid entry due to zone transfer slowness or other caching
issues. In this case we'd end up without a DNS entry after all. So
intead do nothing if the entry is already good.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
@mention-bot
Copy link

@mention-bot mention-bot commented Feb 17, 2017

@agx, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ohadlevy, @isratrade and @timogoebel to be potential reviewers.

Copy link
Member

@dLobatog dLobatog left a comment

@agx One minor comment inline, please check it out. Thanks for the contribution!

@@ -42,7 +42,7 @@ def rebuild_dns
results = {}

DnsInterface::RECORD_TYPES.each do |record_type|
del_dns_record_safe(record_type)
dns_record(record_type).nil? || dns_record(record_type).valid? || del_dns_record_safe(record_type)

This comment has been minimized.

@dLobatog

dLobatog Feb 17, 2017
Member

The first check for .nil? is already done on del_dns_record_safe on app/model/concerns/dns_interface.rb.

Could you move the .valid? check to that method, and add a test on test/models/orchestration/dns_test.rb for rebuild_dns with an already correct DNS record?

This comment has been minimized.

@agx

agx Feb 22, 2017
Author Member

@dLobatog wouldn't that obfuscate the meaning of del_dns_record_safe? It'd rather add a del_incorrect_dns_record

@theforeman-bot
Copy link
Member

@theforeman-bot theforeman-bot commented Jun 27, 2018

Thank you for your contribution, @agx! This PR has been inactive for 6 months, closing for now.
Feel free to reopen when you return to it. This is an automated process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.