Repository: certbot/certbot

Issue:
add_deprecated_argument needs to accept arguments of any type (letsencrypt: error: agree-dev-preview set to 'True' rather than a value)
latest version of the official client installed; just ran git pull.
worked fine until several days ago with a pull i had made then.
webroot auth being used.
centos 7 / nginx (but i'm installing the cert(s) manually)

same error appears on renewal attempts as well as new domain cert requests. 

tried using a cli.ini file as well as full command line only.

no change in results. 

what am i missing? 



Discussion:
The --agree-dev-preview flag/config option is now deprecated; you've found a bug in our option deprecation code.

Remove that setting as a workaround.

Someone else told me it was deprecated and to remove it which I've since done and I still receive the same error. almost as if it's being cached somewhere (not possible right?). i don't know what's up....

Now I'm really confused; I just tried again with a new domain and this time strictly followed the Beta invite's email instructions (with letsencrypt-auto):

/root/.local/share/letsencrypt/bin/letsencrypt certonly -a webroot --webroot-path /usr/lib/mailman -d lists.garbage-juice.com --server https://acme-v01.api.letsencrypt.org/directory --agree-dev-preview

and while it did warn me of the deprecation of the agree-dev-preview command, it worked, for the new cert.

Now I just tried renewing the same cert i just received, this time adding --renew-by-default, and it also now worked fine, while still warning me of the deprecated command.

So now I went back to one of my original domains (one cert, 2 domains) I had been trying to renew for days now (as a test), and SOB, it appears to possibly have worked except i got rateLimited (probably due to my testing).

So IDK what's up but it works now seemingly. WTF!? haha........

Maybe you have a .ini file somewhere ? 

But I was specifying the ini file in my cmd line. It worked now once I went back to simply using the exact example in the beta invite for a new cert. Then modified that by adding renew-by-default for a renewal and should have worked except I hit the rate limit. 

Weird. Not sure why it wasn't working before that. I don't feel I really tried anything different truly. Idk. 

Sincerely,

Fabian Santiago

Sent from my iPhone

> On Dec 4, 2015, at 3:54 PM, Svennd notifications@github.com wrote:
> 
> Maybe you have a .ini file somewhere ?
> 
> —
> Reply to this email directly or view it on GitHub.

probably adding `type=any` to `add_deprecated_argument`'s argparse call will fix this.


Resolving patch:
diff --git a/letsencrypt/le_util.py b/letsencrypt/le_util.py
--- a/letsencrypt/le_util.py
+++ b/letsencrypt/le_util.py
@@ -10,6 +10,8 @@
 import subprocess
 import sys
 
+import configargparse
+
 from letsencrypt import errors
 
 
@@ -278,9 +280,11 @@ def __call__(self, unused1, unused2, unused3, option_string=None):
             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.


Test patch:
diff --git a/letsencrypt/tests/cli_test.py b/letsencrypt/tests/cli_test.py
--- a/letsencrypt/tests/cli_test.py
+++ b/letsencrypt/tests/cli_test.py
@@ -551,6 +551,11 @@ def test_read_file(self):
         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
--- /dev/null
+++ b/letsencrypt/tests/testdata/cli.ini
@@ -0,0 +1 @@
+agree-dev-preview = True