-
Notifications
You must be signed in to change notification settings - Fork 928
Route53: fix deleting records which are part of a multi value record set #2177
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
Open
Sanjays2402
wants to merge
2
commits into
apache:trunk
Choose a base branch
from
Sanjays2402:fix/route53-delete-multi-value-record
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+193
−3
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@Sanjays2402 could you please take a look?
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.
Good catch - that was a real gap. A
Recordfromcreate_record()/ex_create_multi_value_record()(or one built by hand) has no_multi_value/_other_records, so bothdelete_record()andupdate_record()would send a single-value changeset and Route53 would reject it.Pushed 6e2579e. Added
_with_record_set_metadata(), called from bothupdate_record()anddelete_record(): if_multi_valueis absent fromrecord.extrait looks the record set up in the zone and merges the metadata in, keeping any caller-supplied extras (ttl, priority). If the lookup fails or the record is not found it falls back to the old behaviour rather than raising.I used
list_records()rather thanget_record()for the lookup, sinceget_record()only asks Route53 formaxitems=1and then rejects the result when the returned member is not the one requested - for a multi value MX set that raisesRecordDoesNotExistErrorbefore the metadata can be read.New test
test_delete_multi_value_record_without_record_set_metadatabuilds a bareRecordwith no metadata and asserts the DELETE changeset contains all five MX values. It fails without the driver change (only1 ASPMX.L.GOOGLE.COM.is emitted).libcloud/test/dns/test_route53.pyis 25 passed.