-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
nsupdate: fix 'index out of range' error when no TTL answer is given #7219
nsupdate: fix 'index out of range' error when no TTL answer is given #7219
Conversation
Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves ansible-collections#836
6f05078
to
7fe4621
Compare
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.
Thanks for your contribution! I've added a first comment.
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.
If nobody objects, I'll merge by the beginning of next week.
current_ttl = lookup.answer[0].ttl if lookup.answer else lookup.authority[0].ttl | ||
else: | ||
current_ttl = lookup.answer[0].ttl | ||
current_ttl = lookup.answer[0].ttl if lookup.answer else lookup.authority[0].ttl |
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 don't know whether using the SOA TTL as a backup is a correct, but this should definitely help against the reported problems. The worst that can happen is that the module will always report changed instead of failing, which is already a big improvement.
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #7235 🤖 @patchback |
…7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves #836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given (cherry picked from commit 208df2c)
Backport to stable-7: 💚 backport PR created✅ Backport PR branch: Backported as #7236 🤖 @patchback |
@silkeh thanks for your contribution! |
…7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves #836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given (cherry picked from commit 208df2c)
@felixfontein: thanks for the quick response! It is much appreciated. |
…nge' error when no TTL answer is given (#7235) nsupdate: fix 'index out of range' error when no TTL answer is given (#7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves #836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given (cherry picked from commit 208df2c) Co-authored-by: Silke Hofstra <[email protected]>
…nge' error when no TTL answer is given (#7236) nsupdate: fix 'index out of range' error when no TTL answer is given (#7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves #836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given (cherry picked from commit 208df2c) Co-authored-by: Silke Hofstra <[email protected]>
…nsible-collections#7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves ansible-collections#836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given
SUMMARY
Fix a possible
list index out of range
when no answer is returned in thettl_changed
method by applying the existing workaround for NS records to all record types.Resolves #836
ISSUE TYPE
COMPONENT NAME
nsupdate
ADDITIONAL INFORMATION
See #836