-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
catch error if no dns domains exist #34605
Conversation
@gtmanfred Can you fix the lint error please? |
try: | ||
response = query(method='domains', droplet_id=domain, command='records') | ||
except SaltCloudSystemExit | ||
log.debug('Failed to find domains.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really only want to log this at a debug level and then return? That might make debugging hard when the response fails legitimately.
This also brings up another point - do we want to be calling the destroy_dns_records
function if delete_dns_record: True
is not set in the digital ocean config files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is fair, lemme try something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, the reason we always attempt to delete it is because you cannot know the profile that a server was built with. The vm_ data when deleting servers does not have any profile data, it only has the provider data, so because you can't be that granular, it is assumed that stale dns records are bad.
This is noted in the code in line 754.
# TODO: when _vm config data can be made available, we should honor the configuration settings,
# but until then, we should assume stale DNS records are bad, and default behavior should be to
# delete them if we can. When this is resolved, also resolve the comments a couple of lines below.
So I would think that we should do this log and always try to delete.
For digital ocean. Fixes saltstack#33452
try: | ||
response = query(method='domains', droplet_id=domain, command='records') | ||
except SaltCloudSystemExit: | ||
log.debug('Failed to find domains.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be at an error
level or debug
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok with either, but as this is run every time and can't be turned off I had it as debug so it wouldn't show up all the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha.
@rallytime will this be in .2? Please please please?!?! |
It will be On Thu, Jul 14, 2016 at 4:43 PM Andrew Hammond notifications@github.com
|
@ahammond yep! It will be :) |
What does this PR do?
catch error if no dns domains exist for digital ocean.
What issues does this PR fix or reference?
Fixes #33452
Tests written?
No