Skip to content

Commit

Permalink
Merge pull request #1 from miff2000/master
Browse files Browse the repository at this point in the history
Tidy up and update setup.py file
  • Loading branch information
TomCouser authored Mar 23, 2020
2 parents a2c282f + f7118ec commit f125a63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
13 changes: 2 additions & 11 deletions certbot_dns_safedns/dns_safedns.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,15 @@ class _SafeDNSLexiconClient(dns_common_lexicon.LexiconClient):
def __init__(self, auth_token, ttl):
super(_SafeDNSLexiconClient, self).__init__()

config = dns_common_lexicon.build_lexicon_config('safedns', {
'ttl': ttl,
}, {
'auth_token': auth_token,
})
config = dns_common_lexicon.build_lexicon_config('safedns', {'ttl': ttl}, {'auth_token': auth_token})

self.provider = safedns.Provider(config)

def _handle_http_error(self, e, domain_name):
hint = None
if str(e).startswith('400 Client Error:'):
if e.response.status_code == 400:
hint = 'Are your API key and Secret key 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 domain_name in str(e) and str(e).endswith('not found'):
return

super(_SafeDNSLexiconClient, self)._handle_general_error(e, domain_name)
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
with open(path.join(this_directory, 'README.md')) as f:
long_description = f.read()

setup(
Expand All @@ -33,12 +33,12 @@
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ukfast/certbot-dns-safedns",
author="Certbot Project",
author_email='client-dev@letsencrypt.org',
license='Apache License 2.0',
author="UKFast R&D Team",
author_email='support@ukfast.co.uk',
license='MIT',
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
classifiers=[
'Development Status :: 3 - Alpha',
'Development Status :: 5 - Production/Stable',
'Environment :: Plugins',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
Expand All @@ -51,6 +51,7 @@
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Internet :: Name Service (DNS)',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Security',
'Topic :: System :: Installation/Setup',
Expand Down

0 comments on commit f125a63

Please sign in to comment.