From ce664424091730ad93bc92bbd6a209e3ae03622a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E7=8E=AE=E6=96=87?= Date: Fri, 31 Aug 2018 16:40:48 +0800 Subject: [PATCH 1/3] fix error. --- certbot_dns_dnspod/dns_dnspod.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/certbot_dns_dnspod/dns_dnspod.py b/certbot_dns_dnspod/dns_dnspod.py index 771a35f..8f9271b 100644 --- a/certbot_dns_dnspod/dns_dnspod.py +++ b/certbot_dns_dnspod/dns_dnspod.py @@ -3,7 +3,6 @@ import logging import zope.interface from lexicon.providers import dnspod -from tld import get_tld from certbot import errors from certbot import interfaces @@ -51,12 +50,10 @@ class Authenticator(dns_common.DNSAuthenticator): ) def _perform(self, domain, validation_name, validation): - tld_domain = get_tld(domain, fix_protocol=True) - self._get_dnspod_client().add_txt_record(tld_domain, validation_name, validation) + self._get_dnspod_client().add_txt_record(domain, validation_name, validation) def _cleanup(self, domain, validation_name, validation): - tld_domain = get_tld(domain, fix_protocol=True) - self._get_dnspod_client().del_txt_record(tld_domain, validation_name, validation) + self._get_dnspod_client().del_txt_record(domain, validation_name, validation) def _get_dnspod_client(self): return _DNSPodLexiconClient(self.credentials.conf('api-id'), @@ -82,6 +79,5 @@ class _DNSPodLexiconClient(dns_common_lexicon.LexiconClient): hint = None if str(e).startswith('400 Client Error:'): hint = 'Are your API ID and API Token values correct?' - - return errors.PluginError('Error determining zone identifier for {0}: {1}.{2}' + return errors.PluginError('Error determining zone identifier for {0}: {1}.{2}' .format(domain_name, e, ' ({0})'.format(hint) if hint else '')) From e787e0696bcb9ca0e07b4344778cfc945bdb7835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E7=8E=AE=E6=96=87?= Date: Fri, 31 Aug 2018 17:28:20 +0800 Subject: [PATCH 2/3] remove dependency --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 11c0c04..c9872ca 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,6 @@ install_requires = [ 'dns-lexicon', 'mock', 'setuptools', - 'tld', 'zope.interface', ] From ec489e4074eb80d638508f4efa18ec5887325c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E7=8E=AE=E6=96=87?= Date: Fri, 31 Aug 2018 20:00:35 +0800 Subject: [PATCH 3/3] fix error while obtaining certification for sub domain --- certbot_dns_dnspod/dns_dnspod.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/certbot_dns_dnspod/dns_dnspod.py b/certbot_dns_dnspod/dns_dnspod.py index 8f9271b..0d4b089 100644 --- a/certbot_dns_dnspod/dns_dnspod.py +++ b/certbot_dns_dnspod/dns_dnspod.py @@ -81,3 +81,8 @@ class _DNSPodLexiconClient(dns_common_lexicon.LexiconClient): hint = 'Are your API ID and API Token values correct?' return errors.PluginError('Error determining zone identifier for {0}: {1}.{2}' .format(domain_name, e, ' ({0})'.format(hint) if hint else '')) + + def _handle_general_error(self, e, domain_name): + if not str(e).startswith('Domain name invalid'): + return errors.PluginError('Unexpected error determining zone identifier for {0}: {1}' + .format(domain_name, e))