-
Notifications
You must be signed in to change notification settings - Fork 1.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
[cloudflare_dns] KeyError: 'success' if top level domain is blocked #236
Comments
Files identified in the description: If these files are inaccurate, please update the |
@lucasbasquerotto: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information. Here are the items we could not find in your description:
Please set the description of this issue with this template: |
Files identified in the description: If these files are inaccurate, please update the |
@lucasbasquerotto Thanks for the debugging. Are you interested in raising a PR for your findings? Let me know if not. |
I made the PR #243 The errors that have the
For the cases in which the
|
Fix errors of the type KeyError: 'success' to show a more meaningful message Fixes: #236
name: 🐛 Bug report
SUMMARY
I have been using this cloudflare module to manage my domains at cloudflare for more than 1 year, and it worked fine. I have a free domain that ends with
.tk
, and for some obscure reason, 2 days ago, Cloudflare stopped allowing adding such domains through the API.ISSUE TYPE
COMPONENT NAME
cloudflare_dns
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Docker container running inside Ubuntu 18.04
STEPS TO REPRODUCE
Use the
cloudflare_dns
module with a domain ending withtk
.EXPECTED RESULTS
Meaningful error.
ACTUAL RESULTS
Bad error (
KeyError: 'success'
).ADDITIONAL INFORMATION
When a new record is created, the module works. But when it's updated or deleted I received the error:
Which tells nothing in the end, except that the following line throws an error:
community.general/plugins/modules/net_tools/cloudflare_dns.py
Line 499 in 8f90360
when it tries to access
result['success']
, because in this case it's not evenfalse
, it is not defined at all.I changed the following lines:
to:
and now I receive a much better error:
msg: 'API user does not have permission; Status: 401; Method: DELETE: Call: /zones/a8222778e37a0276468013d671b39e15/dns_records/b8051d66e565436cd6f24fbd34621f52; Error details: You cannot use this API for domains with a .cf, .ga, .gq, .ml, or .tk TLD (top-level domain). To configure the DNS settings for this domain, use the Cloudflare Dashboard.'
Unfortunately, it seems I won't be able to continue to use this domain with Cloudflare, but at least on the ansible side, the error is more meaningful.
The text was updated successfully, but these errors were encountered: