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.
Aliyun has supported more types of resolution line enumeration than before. ALIDNS_LINE_MAP is not updated with the latest. Please refer to: https://help.aliyun.com/document_detail/29807.html
If the Aliyun DNS is configured with a resolution line other than the ones populated in
ALIDNS_LINE_MAP
, such asos_euro_gb
in the example below,black_dnsync.dns_client.AliyunClient#__to_record
throws outUnsupportedLineError
.If we update
ALIDNS_LINE_MAP
with the enumeration provided by Aliyun, it will become bulged with hundreds of lines. It's unmaintainable as Aliyun regularly update their APIs.IMHO we could delegate the responsibility to check the validity of resolution line enumeration to Aliyun DNS API instead, thus relieve the burden from black-dnsync.
Aliyun DNS API comes with request parameter validation and responds with
SubDomainInvalid.Line
if the resolution line parameter is invalid.However, removing
UnsupportedLineError
present the risk of failing amid record updating and committing only partial changes to Aliyun.Notice that
line=mumblejumble
is invalid thus interrupts the updating process withAPIError
.Other DNS providers (DNSPod, DNSimple, CloudXNS) are not taken into account yet.