route53: rename to match other DNS plugins (#4747)

This change renames certbot-route53 to certbot-dns-route53 and updates
the package's setup.py file to maintain backwards compatibility.

Testing Done:
 * Run `certbot` with `-a certbot-route53:auth`, verify the plugin runs.
 * Run `certbot` with `--dns-route53`, verify the plugin runs.
This commit is contained in:
Zach Shepherd
2017-06-06 15:41:04 -07:00
committed by Brad Warren
parent 7531c98916
commit e749937465
19 changed files with 40 additions and 20 deletions
@@ -30,6 +30,6 @@ To generate a certificate:
``` ```
certbot certonly \ certbot certonly \
-n --agree-tos --email DEVOPS@COMPANY.COM \ -n --agree-tos --email DEVOPS@COMPANY.COM \
-a certbot-route53:auth \ --dns-route53 \
-d MY.DOMAIN.NAME -d MY.DOMAIN.NAME
``` ```
@@ -0,0 +1,12 @@
"""Shim around `~certbot_dns_route53.dns_route53` for backwards compatibility."""
import warnings
from certbot_dns_route53 import dns_route53
class Authenticator(dns_route53.Authenticator):
"""Shim around `~certbot_dns_route53.dns_route53.Authenticator` for backwards compatibility."""
def __init__(self, *args, **kwargs):
warnings.warn("The 'authenticator' module was renamed 'dns_route53'",
DeprecationWarning)
super(Authenticator, self).__init__(*args, **kwargs)
@@ -13,7 +13,7 @@ from certbot.plugins import dns_common
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
INSTRUCTIONS = ( INSTRUCTIONS = (
"To use certbot-route53, configure credentials as described at " "To use certbot-dns-route53, configure credentials as described at "
"https://boto3.readthedocs.io/en/latest/guide/configuration.html#best-practices-for-configuring-credentials " # pylint: disable=line-too-long "https://boto3.readthedocs.io/en/latest/guide/configuration.html#best-practices-for-configuring-credentials " # pylint: disable=line-too-long
"and add the necessary permissions for Route53 access.") "and add the necessary permissions for Route53 access.")
@@ -91,7 +91,7 @@ class Authenticator(dns_common.DNSAuthenticator):
response = self.r53.change_resource_record_sets( response = self.r53.change_resource_record_sets(
HostedZoneId=zone_id, HostedZoneId=zone_id,
ChangeBatch={ ChangeBatch={
"Comment": "certbot-route53 certificate validation " + action, "Comment": "certbot-dns-route53 certificate validation " + action,
"Changes": [ "Changes": [
{ {
"Action": action, "Action": action,
@@ -1,4 +1,4 @@
"""Tests for certbot_route53.authenticator""" """Tests for certbot_dns_route53.dns_route53.Authenticator"""
import unittest import unittest
@@ -14,7 +14,7 @@ class AuthenticatorTest(unittest.TestCase, dns_test_common.BaseAuthenticatorTest
# pylint: disable=protected-access # pylint: disable=protected-access
def setUp(self): def setUp(self):
from certbot_route53.authenticator import Authenticator from certbot_dns_route53.dns_route53 import Authenticator
super(AuthenticatorTest, self).setUp() super(AuthenticatorTest, self).setUp()
@@ -111,7 +111,7 @@ class ClientTest(unittest.TestCase):
} }
def setUp(self): def setUp(self):
from certbot_route53.authenticator import Authenticator from certbot_dns_route53.dns_route53 import Authenticator
super(ClientTest, self).setUp() super(ClientTest, self).setUp()
@@ -1,6 +1,6 @@
{ {
"Version": "2012-10-17", "Version": "2012-10-17",
"Id": "certbot-route53 sample policy", "Id": "certbot-dns-route53 sample policy",
"Statement": [ "Statement": [
{ {
"Effect": "Allow", "Effect": "Allow",
@@ -17,7 +17,7 @@ install_requires = [
] ]
setup( setup(
name='certbot-route53', name='certbot-dns-route53',
version=version, version=version,
description="Route53 DNS Authenticator plugin for Certbot", description="Route53 DNS Authenticator plugin for Certbot",
url='https://github.com/certbot/certbot', url='https://github.com/certbot/certbot',
@@ -52,8 +52,9 @@ setup(
keywords=['certbot', 'route53', 'aws'], keywords=['certbot', 'route53', 'aws'],
entry_points={ entry_points={
'certbot.plugins': [ 'certbot.plugins': [
'auth = certbot_route53.authenticator:Authenticator' 'dns-route53 = certbot_dns_route53.dns_route53:Authenticator',
'certbot-route53:auth = certbot_dns_route53.dns_route53:Authenticator'
], ],
}, },
test_suite='certbot_route53', test_suite='certbot_dns_route53',
) )
+3
View File
@@ -1249,6 +1249,9 @@ def _plugins_parsing(helpful, plugins):
helpful.add(["plugins", "certonly"], "--dns-nsone", action="store_true", helpful.add(["plugins", "certonly"], "--dns-nsone", action="store_true",
help=('Obtain certificates using a DNS TXT record (if you are ' help=('Obtain certificates using a DNS TXT record (if you are '
'using NS1 for DNS).')) 'using NS1 for DNS).'))
helpful.add(["plugins", "certonly"], "--dns-route53", action="store_true",
help=('Obtain certificates using a DNS TXT record (if you are using Route53 for '
'DNS).'))
# things should not be reorder past/pre this comment: # things should not be reorder past/pre this comment:
# plugins_group should be displayed in --help before plugin # plugins_group should be displayed in --help before plugin
+1
View File
@@ -34,6 +34,7 @@ class PluginEntryPoint(object):
"certbot-dns-dnsimple", "certbot-dns-dnsimple",
"certbot-dns-google", "certbot-dns-google",
"certbot-dns-nsone", "certbot-dns-nsone",
"certbot-dns-route53",
"certbot-nginx", "certbot-nginx",
] ]
"""Distributions for which prefix will be omitted.""" """Distributions for which prefix will be omitted."""
+4 -1
View File
@@ -134,7 +134,8 @@ def choose_plugin(prepared, question):
return None return None
noninstaller_plugins = ["webroot", "manual", "standalone", "dns-cloudflare", "dns-cloudxns", noninstaller_plugins = ["webroot", "manual", "standalone", "dns-cloudflare", "dns-cloudxns",
"dns-digitalocean", "dns-dnsimple", "dns-google", "dns-nsone"] "dns-digitalocean", "dns-dnsimple", "dns-google", "dns-route53",
"dns-nsone"]
def record_chosen_plugins(config, plugins, auth, inst): def record_chosen_plugins(config, plugins, auth, inst):
"Update the config entries to reflect the plugins we actually selected." "Update the config entries to reflect the plugins we actually selected."
@@ -250,6 +251,8 @@ def cli_plugin_requests(config):
req_auth = set_configurator(req_auth, "dns-google") req_auth = set_configurator(req_auth, "dns-google")
if config.dns_nsone: if config.dns_nsone:
req_auth = set_configurator(req_auth, "dns-nsone") req_auth = set_configurator(req_auth, "dns-nsone")
if config.dns_route53:
req_auth = set_configurator(req_auth, "dns-route53")
logger.debug("Requested authenticator %s and installer %s", req_auth, req_inst) logger.debug("Requested authenticator %s and installer %s", req_auth, req_inst)
return req_auth, req_inst return req_auth, req_inst
+1 -1
View File
@@ -20,7 +20,7 @@ fi
-e certbot-dns-dnsimple \ -e certbot-dns-dnsimple \
-e certbot-dns-google \ -e certbot-dns-google \
-e certbot-dns-nsone \ -e certbot-dns-nsone \
-e certbot-dns-route53 \
-e certbot-nginx \ -e certbot-nginx \
-e certbot-route53 \
-e letshelp-certbot \ -e letshelp-certbot \
-e certbot-compatibility-test -e certbot-compatibility-test
+1 -1
View File
@@ -19,7 +19,7 @@ fi
-e certbot-dns-dnsimple \ -e certbot-dns-dnsimple \
-e certbot-dns-google \ -e certbot-dns-google \
-e certbot-dns-nsone \ -e certbot-dns-nsone \
-e certbot-dns-route53 \
-e certbot-nginx \ -e certbot-nginx \
-e certbot-route53 \
-e letshelp-certbot \ -e letshelp-certbot \
-e certbot-compatibility-test -e certbot-compatibility-test
+3 -3
View File
@@ -9,7 +9,7 @@
# -e makes sure we fail fast and don't submit coveralls submit # -e makes sure we fail fast and don't submit coveralls submit
if [ "xxx$1" = "xxx" ]; then if [ "xxx$1" = "xxx" ]; then
pkgs="certbot acme certbot_apache certbot_dns_cloudflare certbot_dns_cloudxns certbot_dns_digitalocean certbot_dns_dnsimple certbot_dns_google certbot_dns_nsone certbot_nginx certbot_route53 letshelp_certbot" pkgs="certbot acme certbot_apache certbot_dns_cloudflare certbot_dns_cloudxns certbot_dns_digitalocean certbot_dns_dnsimple certbot_dns_google certbot_dns_nsone certbot_dns_route53 certbot_nginx letshelp_certbot"
else else
pkgs="$@" pkgs="$@"
fi fi
@@ -33,10 +33,10 @@ cover () {
min=99 min=99
elif [ "$1" = "certbot_dns_nsone" ]; then elif [ "$1" = "certbot_dns_nsone" ]; then
min=99 min=99
elif [ "$1" = "certbot_dns_route53" ]; then
min=99
elif [ "$1" = "certbot_nginx" ]; then elif [ "$1" = "certbot_nginx" ]; then
min=97 min=97
elif [ "$1" = "certbot_route53" ]; then
min=99
elif [ "$1" = "letshelp_certbot" ]; then elif [ "$1" = "letshelp_certbot" ]; then
min=100 min=100
else else
+4 -4
View File
@@ -37,10 +37,10 @@ dns_plugin_commands =
nosetests -v certbot_dns_digitalocean --processes=-1 nosetests -v certbot_dns_digitalocean --processes=-1
pip install -e certbot-dns-google pip install -e certbot-dns-google
nosetests -v certbot_dns_google --processes=-1 nosetests -v certbot_dns_google --processes=-1
pip install -e certbot-route53 pip install -e certbot-dns-route53
nosetests -v certbot_route53 --processes=-1 --process-timeout=25 nosetests -v certbot_dns_route53 --processes=-1 --process-timeout=25
dns_plugin_install_args = -e certbot-dns-cloudflare -e certbot-dns-digitalocean -e certbot-dns-google -e certbot-route53 dns_plugin_install_args = -e certbot-dns-cloudflare -e certbot-dns-digitalocean -e certbot-dns-google -e certbot-dns-route53
dns_plugin_paths = certbot-dns-cloudflare/certbot_dns_cloudflare certbot-dns-digitalocean/certbot_dns_digitalocean certbot-dns-google/certbot_dns_google certbot-route53/certbot_route53 dns_plugin_paths = certbot-dns-cloudflare/certbot_dns_cloudflare certbot-dns-digitalocean/certbot_dns_digitalocean certbot-dns-google/certbot_dns_google certbot-dns-route53/certbot_dns_route53
lexicon_dns_plugin_commands = lexicon_dns_plugin_commands =
pip install -e certbot-dns-cloudxns pip install -e certbot-dns-cloudxns