From b77d288adb0f78db6032a1d066a546d3c99ca9b0 Mon Sep 17 00:00:00 2001 From: sagi Date: Wed, 25 May 2016 21:49:53 +0000 Subject: [PATCH] Use cli.py to set .staple given .must_staple --- certbot/cli.py | 3 +++ certbot/tests/cli_test.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/certbot/cli.py b/certbot/cli.py index 3bd565496..05a189712 100644 --- a/certbot/cli.py +++ b/certbot/cli.py @@ -343,6 +343,9 @@ class HelpfulArgumentParser(object): if parsed_args.csr: self.handle_csr(parsed_args) + if parsed_args.must_staple: + parsed_args.staple = True + hooks.validate_hooks(parsed_args) return parsed_args diff --git a/certbot/tests/cli_test.py b/certbot/tests/cli_test.py index 4ae69e69d..00c9a0a26 100644 --- a/certbot/tests/cli_test.py +++ b/certbot/tests/cli_test.py @@ -422,6 +422,13 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods for arg in conflicting_args: self.assertTrue(arg in error.message) + def test_must_staple_flag(self): + parse = self._get_argument_parser() + short_args = ['--must-staple'] + namespace = parse(short_args) + self.assertTrue(namespace.must_staple) + self.assertTrue(namespace.staple) + def test_staging_flag(self): parse = self._get_argument_parser() short_args = ['--staging']