Skip to content

Route53: keep MX priority and SRV weight/port when updating or deleting records - #2224

Open
anishmehta24 wants to merge 1 commit into
apache:trunkfrom
anishmehta24:route53-mx-srv-record-values
Open

anishmehta24 wants to merge 1 commit into
apache:trunkfrom
anishmehta24:route53-mx-srv-record-values

Conversation

@anishmehta24

Copy link
Copy Markdown

Route53: keep MX priority and SRV weight/port when updating or deleting records

Description

_to_record splits the MX priority and the SRV priority, weight and port out of the value Route53 stores, but they are not all put back when a record is written:

  • update_record on a record that is part of a multi value set (e.g. one of the MX values) sends every value without its priority, so the DELETE doesn't match what Route53 stores and the CREATE values are invalid.
  • update_record and delete_record on SRV records send priority target instead of priority weight port target. With the list_records fixture, deleting the SRV record sends 1 xmpp-server.example.com. instead of 1 10 5269 xmpp-server.example.com..

#2177 fixed this for multi value MX deletes. This uses its _to_record_value helper in the update path and in _post_changeset as well, and makes it restore the SRV weight and port.

Three new tests check the posted changeset (multi value MX update, multi value SRV delete, single value SRV update), plus an SRV case in test_to_record_value; they fail on trunk and pass with the fix. libcloud/test/dns passes (541 tests), and black, isort, flake8 and pylint -E pass. I couldn't run it against real Route53.

Status

done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)

_to_record splits the MX priority and the SRV priority, weight and port
out of the stored value. When a record was written back, the multi value
update path dropped the MX priority and every path dropped the SRV
weight and port, so DELETE did not match the stored values and CREATE
sent invalid ones.

Rebuild the value with _to_record_value everywhere, and have it restore
the SRV weight and port.
@anishmehta24
anishmehta24 force-pushed the route53-mx-srv-record-values branch from 02620a5 to 187efb5 Compare November 13, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant