From 1c05b9bd07191512b33dabc50c0b617d58c4be7d Mon Sep 17 00:00:00 2001 From: Brandon Moore Date: Mon, 4 Nov 2019 12:50:57 -0500 Subject: [PATCH] Dropped deprecated flags from commands (#7482) This pull request addresses #7451 by removing the deprecated flags. * Dropped deprecated flags from commands * Updated changelog for dropped flags and deleted outdated tests * removed init-script part of apache test --- CHANGELOG.md | 1 + certbot-apache/certbot_apache/configurator.py | 2 -- .../certbot_apache/tests/configurator_test.py | 4 ---- certbot/cli.py | 3 --- certbot/tests/cli_test.py | 10 ---------- certbot/tests/main_test.py | 5 ----- 6 files changed, 1 insertion(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8477525b1..13f425209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). * CLI flags --tls-sni-01-port and --tls-sni-01-address have been removed. * The values tls-sni and tls-sni-01 for the --preferred-challenges flag are no longer accepted. +* Removed the flags: `--agree-dev-preview`, `--dialog`, and `--apache-init-script` * acme.standalone.BaseRequestHandlerWithLogging and acme.standalone.simple_tls_sni_01_server have been deprecated and will be removed in a future release of the library. diff --git a/certbot-apache/certbot_apache/configurator.py b/certbot-apache/certbot_apache/configurator.py index f7c27bf76..3868451f5 100644 --- a/certbot-apache/certbot_apache/configurator.py +++ b/certbot-apache/certbot_apache/configurator.py @@ -174,8 +174,6 @@ class ApacheConfigurator(common.Installer): "(Only Ubuntu/Debian currently)") add("ctl", default=DEFAULTS["ctl"], help="Full path to Apache control script") - util.add_deprecated_argument( - add, argument_name="init-script", nargs=1) def __init__(self, *args, **kwargs): """Initialize an Apache Configurator. diff --git a/certbot-apache/certbot_apache/tests/configurator_test.py b/certbot-apache/certbot_apache/tests/configurator_test.py index bf5281d29..52c5b437c 100644 --- a/certbot-apache/certbot_apache/tests/configurator_test.py +++ b/certbot-apache/certbot_apache/tests/configurator_test.py @@ -108,13 +108,9 @@ class MultipleVhostsTest(util.ApacheTest): exp[k.replace("_", "-")] = ApacheConfigurator.OS_DEFAULTS[k] # Special cases exp["vhost-root"] = None - exp["init-script"] = None found = set() for call in mock_add.call_args_list: - # init-script is a special case: deprecated argument - if call[0][0] != "init-script": - self.assertEqual(exp[call[0][0]], call[1]['default']) found.add(call[0][0]) # Make sure that all (and only) the expected values exist diff --git a/certbot/cli.py b/certbot/cli.py index c4ddcddbe..97a0abbfb 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -1246,9 +1246,6 @@ def prepare_and_parse_args(plugins, args, detect_defaults=False): # pylint: dis default=flag_default("autorenew"), dest="autorenew", help="Disable auto renewal of certificates.") - helpful.add_deprecated_argument("--agree-dev-preview", 0) - helpful.add_deprecated_argument("--dialog", 0) - # Populate the command line parameters for new style enhancements enhancements.populate_cli(helpful.add) diff --git a/certbot/tests/cli_test.py b/certbot/tests/cli_test.py index e8d8282df..7f3830d72 100644 --- a/certbot/tests/cli_test.py +++ b/certbot/tests/cli_test.py @@ -265,16 +265,6 @@ class ParseTest(unittest.TestCase): # pylint: disable=too-many-public-methods self.assertTrue(namespace.must_staple) self.assertTrue(namespace.staple) - def test_no_gui(self): - args = ['renew', '--dialog'] - with mock.patch("certbot.util.logger.warning") as mock_warn: - namespace = self.parse(args) - - self.assertTrue(namespace.noninteractive_mode) - self.assertEqual(mock_warn.call_count, 1) - self.assertTrue("is deprecated" in mock_warn.call_args[0][0]) - self.assertEqual("--dialog", mock_warn.call_args[0][1]) - def _check_server_conflict_message(self, parser_args, conflicting_args): try: self.parse(parser_args) diff --git a/certbot/tests/main_test.py b/certbot/tests/main_test.py index b7477e355..d8c7f4ab8 100644 --- a/certbot/tests/main_test.py +++ b/certbot/tests/main_test.py @@ -1381,11 +1381,6 @@ class MainTest(test_util.ConfigTestCase): # pylint: disable=too-many-public-met jose.ComparableX509(cert), mock.ANY) - def test_agree_dev_preview_config(self): - with mock.patch('certbot.main.run') as mocked_run: - self._call(['-c', test_util.vector_path('cli.ini')]) - self.assertTrue(mocked_run.called) - @mock.patch('certbot.log.post_arg_parse_setup') def test_register(self, _): with mock.patch('certbot.main.client') as mocked_client: