diff --git a/certbot_dns_dnspod/dns_dnspod.py b/certbot_dns_dnspod/dns_dnspod.py index 771a35f..0d4b089 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,10 @@ 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 '')) + + 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)) 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', ]