From d30afbea5782bdb30c36661f1a9cbaea0bfc5bc8 Mon Sep 17 00:00:00 2001 From: Oshawk Date: Mon, 3 Dec 2018 23:32:47 +0000 Subject: [PATCH] Remove duplicate route53 options (#6405) * Remove duplicate route53 options Duplicate route53 option (certbot-route53:auth) removed. * Remove duplicate route53 options from help Removed duplicate route53 options from help by adding a couple of if statements in cli.py. * Fix formatting * Use cleaner solution to remove duplicate route53 options from help Used a cleaner method to remove the duplicate option from the help text * Fix line too long * Add regression test Added a regression test and fixed a couple of minor issues. * Fix trailing whitespace * Add missing newline * Put newline in correct place --- certbot/cli.py | 4 +++- certbot/tests/cli_test.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/certbot/cli.py b/certbot/cli.py index 7d2a6ccfc..8557b12c8 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -859,7 +859,9 @@ class HelpfulArgumentParser(object): if chosen_topic == "everything": chosen_topic = "run" if chosen_topic == "all": - return dict([(t, True) for t in self.help_topics]) + # Addition of condition closes #6209 (removal of duplicate route53 option). + return dict([(t, True) if t != 'certbot-route53:auth' else (t, False) + for t in self.help_topics]) elif not chosen_topic: return dict([(t, False) for t in self.help_topics]) else: diff --git a/certbot/tests/cli_test.py b/certbot/tests/cli_test.py index 69ef16597..1448b86e7 100644 --- a/certbot/tests/cli_test.py +++ b/certbot/tests/cli_test.py @@ -431,6 +431,11 @@ class ParseTest(unittest.TestCase): # pylint: disable=too-many-public-methods self.assertRaises(errors.Error, self.parse, "--allow-subset-of-names -d *.example.org".split()) + def test_route53_no_revert(self): + for help_flag in ['-h', '--help']: + for topic in ['all', 'plugins', 'dns-route53']: + self.assertFalse('certbot-route53:auth' in self._help_output([help_flag, topic])) + class DefaultTest(unittest.TestCase): """Tests for certbot.cli._Default."""