From 9248ba1e9696e4f7b3d79fdda40edce5494a0a26 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 11 Dec 2015 16:06:12 -0800 Subject: [PATCH 1/3] Fix deprecation bug --- letsencrypt/le_util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/letsencrypt/le_util.py b/letsencrypt/le_util.py index fe63c70af..c630f4fe7 100644 --- a/letsencrypt/le_util.py +++ b/letsencrypt/le_util.py @@ -1,6 +1,7 @@ """Utilities for all Let's Encrypt.""" import argparse import collections +import configargparse import errno import logging import os @@ -278,9 +279,11 @@ def add_deprecated_argument(add_argument, argument_name, nargs): sys.stderr.write( "Use of {0} is deprecated.\n".format(option_string)) + configargparse.ACTION_TYPES_THAT_DONT_NEED_A_VALUE.add(ShowWarning) add_argument(argument_name, action=ShowWarning, help=argparse.SUPPRESS, nargs=nargs) + def check_domain_sanity(domain): """Method which validates domain value and errors out if the requirements are not met. From 75bc227cfac6bb4de7246597d78a400d1b788b1a Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 11 Dec 2015 16:13:06 -0800 Subject: [PATCH 2/3] Test setting agree-dev-preview in config file --- letsencrypt/tests/cli_test.py | 5 +++++ letsencrypt/tests/testdata/cli.ini | 1 + 2 files changed, 6 insertions(+) create mode 100644 letsencrypt/tests/testdata/cli.ini diff --git a/letsencrypt/tests/cli_test.py b/letsencrypt/tests/cli_test.py index e7ae5de23..2b56c5abe 100644 --- a/letsencrypt/tests/cli_test.py +++ b/letsencrypt/tests/cli_test.py @@ -551,6 +551,11 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods self.assertEqual(path, os.path.abspath(path)) self.assertEqual(contents, test_contents) + def test_agree_dev_preview_config(self): + with MockedVerb('run') as mocked_run: + self._call(['-c', test_util.vector_path('cli.ini')]) + self.assertTrue(mocked_run.called) + class DetermineAccountTest(unittest.TestCase): """Tests for letsencrypt.cli._determine_account.""" diff --git a/letsencrypt/tests/testdata/cli.ini b/letsencrypt/tests/testdata/cli.ini new file mode 100644 index 000000000..8ef506071 --- /dev/null +++ b/letsencrypt/tests/testdata/cli.ini @@ -0,0 +1 @@ +agree-dev-preview = True From 3521c92be3b2c186ea56fdd3e57b21997ba1dd4a Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 11 Dec 2015 16:14:36 -0800 Subject: [PATCH 3/3] Fixed import ordering --- letsencrypt/le_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/letsencrypt/le_util.py b/letsencrypt/le_util.py index c630f4fe7..64295a80f 100644 --- a/letsencrypt/le_util.py +++ b/letsencrypt/le_util.py @@ -1,7 +1,6 @@ """Utilities for all Let's Encrypt.""" import argparse import collections -import configargparse import errno import logging import os @@ -11,6 +10,8 @@ import stat import subprocess import sys +import configargparse + from letsencrypt import errors