[Cloudflare] Fix list_record_types advertising URL instead of LOC - #2175
Merged
Conversation
The CloudFlare driver's RECORD_TYPE_MAP had an entry keyed on RecordType.URL with the value "LOC". Every other entry is an identity mapping, and the value "LOC" shows LOC support was intended: the key is a copy-paste slip. As a result list_record_types() advertised RecordType.URL -- which is not a Cloudflare DNS record type (URL forwarding is done via Page Rules, not DNS records) -- and omitted RecordType.LOC, which Cloudflare does support. Correct the key to RecordType.LOC so the supported LOC type is reported and the unsupported URL type is not. Extends the existing test_list_record_types to assert LOC is present and URL is absent.
Reference apache#2175 under the 3.9.2 DNS section.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the Cloudflare DNS driver’s advertised record types by correcting a RECORD_TYPE_MAP key so list_record_types() reports the supported LOC type and no longer reports the unsupported URL type.
Changes:
- Update Cloudflare driver
RECORD_TYPE_MAPto useRecordType.LOCinstead ofRecordType.URL. - Extend the Cloudflare DNS driver test to assert
LOCis present andURLis absent. - Add a changelog entry describing the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| libcloud/dns/drivers/cloudflare.py | Corrects the record type mapping so list_record_types() advertises LOC instead of URL. |
| libcloud/test/dns/test_cloudflare.py | Adds assertions verifying LOC is included and URL is excluded from list_record_types(). |
| CHANGES.rst | Documents the Cloudflare list_record_types fix in the changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
micafer
enabled auto-merge
July 31, 2026 10:32
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2175 +/- ##
=======================================
Coverage 83.39% 83.39%
=======================================
Files 351 351
Lines 81519 81521 +2
Branches 8747 8747
=======================================
+ Hits 67982 67984 +2
Misses 10744 10744
Partials 2793 2793
🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The CloudFlare DNS driver's
RECORD_TYPE_MAPhas one entry that doesn't match the pattern of the rest:Every other entry is an identity mapping, and the value
"LOC"shows that LOC support was intended — the key is a copy-paste slip.RecordType.URLandRecordType.LOCboth exist inlibcloud/dns/types.py.Because
list_record_types()returnsRECORD_TYPE_MAP.keys(), the driver:RecordType.URL, which is not a Cloudflare DNS record type (Cloudflare does URL forwarding via Page/Redirect Rules, not DNS records), andRecordType.LOC, which Cloudflare does support.Reproduce
Fix
Correct the key to
RecordType.LOC, making it an identity mapping like the others:The map value isn't consumed by
create_record(which passes the record type through directly), so the only observable effect islist_record_types(), which now correctly reportsLOCand no longer reportsURL. The entry count is unchanged (9).Tests
Extended
test_list_record_typesto assertRecordType.LOCis present andRecordType.URLis absent. It fails on the current code and passes with the fix. Fulltest_cloudflare.pysuite:29 passed. flake8 clean.