{"action":"created","comment":{"url":"https://api.github.com/repos/certbot/certbot/pulls/comments/117564169","pull_request_review_id":39287609,"id":117564169,"diff_hunk":"@@ -114,39 +112,53 @@ def running(self):\n SUPPORTED_CHALLENGES = [challenges.TLSSNI01, challenges.HTTP01]\n \n \n-def supported_challenges_validator(data):\n-    \"\"\"Supported challenges validator for the `argparse`.\n+class SupportedChallengesAction(argparse.Action):\n+    \"\"\"Action class for parsing standalone_supported_challenges.\"\"\"\n \n-    It should be passed as `type` argument to `add_argument`.\n+    def __call__(self, parser, namespace, values, option_string=None):","path":"certbot/plugins/standalone.py","position":26,"original_position":26,"commit_id":"6250ad2f15af244b19d3b6b3d133b8f80f846e69","original_commit_id":"a2b31b2a788b8131fba962d57555ad85f61fe524","user":{"login":"bmw","id":6504915,"avatar_url":"https://avatars3.githubusercontent.com/u/6504915?v=3","gravatar_id":"","url":"https://api.github.com/users/bmw","html_url":"https://github.com/bmw","followers_url":"https://api.github.com/users/bmw/followers","following_url":"https://api.github.com/users/bmw/following{/other_user}","gists_url":"https://api.github.com/users/bmw/gists{/gist_id}","starred_url":"https://api.github.com/users/bmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmw/subscriptions","organizations_url":"https://api.github.com/users/bmw/orgs","repos_url":"https://api.github.com/users/bmw/repos","events_url":"https://api.github.com/users/bmw/events{/privacy}","received_events_url":"https://api.github.com/users/bmw/received_events","type":"User","site_admin":false},"body":"More `argparse` fun! As documented [here](https://docs.python.org/2.7/library/argparse.html#default), if the default is a `str` and you specify a `type` argument when adding the CLI flag to the parser, the `type` parameter gets called with the default before adding it to the namespace. As a result, sometimes when `type` was called we were just parsing the default rather than a user provided value so we had to use our `set_by_cli()` function to differentiate between these cases.\r\n\r\nThis avoids all that because the `action` argument is only called if the user provides a value.","created_at":"2017-05-19T20:02:44Z","updated_at":"2017-05-19T20:02:44Z","html_url":"https://github.com/certbot/certbot/pull/4691#discussion_r117564169","pull_request_url":"https://api.github.com/repos/certbot/certbot/pulls/4691","_links":{"self":{"href":"https://api.github.com/repos/certbot/certbot/pulls/comments/117564169"},"html":{"href":"https://github.com/certbot/certbot/pull/4691#discussion_r117564169"},"pull_request":{"href":"https://api.github.com/repos/certbot/certbot/pulls/4691"}}},"pull_request":{"url":"https://api.github.com/repos/certbot/certbot/pulls/4691","id":121388941,"html_url":"https://github.com/certbot/certbot/pull/4691","diff_url":"https://github.com/certbot/certbot/pull/4691.diff","patch_url":"https://github.com/certbot/certbot/pull/4691.patch","issue_url":"https://api.github.com/repos/certbot/certbot/issues/4691","number":4691,"state":"open","locked":false,"title":"Fix defaults on older systems","user":{"login":"bmw","id":6504915,"avatar_url":"https://avatars3.githubusercontent.com/u/6504915?v=3","gravatar_id":"","url":"https://api.github.com/users/bmw","html_url":"https://github.com/bmw","followers_url":"https://api.github.com/users/bmw/followers","following_url":"https://api.github.com/users/bmw/following{/other_user}","gists_url":"https://api.github.com/users/bmw/gists{/gist_id}","starred_url":"https://api.github.com/users/bmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmw/subscriptions","organizations_url":"https://api.github.com/users/bmw/orgs","repos_url":"https://api.github.com/users/bmw/repos","events_url":"https://api.github.com/users/bmw/events{/privacy}","received_events_url":"https://api.github.com/users/bmw/received_events","type":"User","site_admin":false},"body":"This fixes #3987 as the call to `set_by_default` can be removed entirely. Additionally, `logger.warning` can be used rather than writing to `stderr` directly because #3184 has been resolved and we're guaranteed to having logging setup. `supported_challenges_validator` was moved to `SupportedChallengesAction` so `argparse.ArgumentError` can be easily used to provide nice error output.\r\n\r\nThe easiest way to test this is on Debian 7.0 Wheezy. After installing Certbot using our developer instructions, if you run `certbot --help all` on `master`, you'll see defaults like:\r\n```\r\n  --nginx-server-root NGINX_SERVER_ROOT\r\n                        Nginx server root directory. (default:\r\n                        <certbot.cli._Default object at 0x3c89210>)\r\n```\r\nIf you check out this branch, the problem goes away.","created_at":"2017-05-18T22:12:27Z","updated_at":"2017-05-19T20:02:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"894df1b6390c64f6295c5e2e5311ec8e123a16f9","assignee":{"login":"bmw","id":6504915,"avatar_url":"https://avatars3.githubusercontent.com/u/6504915?v=3","gravatar_id":"","url":"https://api.github.com/users/bmw","html_url":"https://github.com/bmw","followers_url":"https://api.github.com/users/bmw/followers","following_url":"https://api.github.com/users/bmw/following{/other_user}","gists_url":"https://api.github.com/users/bmw/gists{/gist_id}","starred_url":"https://api.github.com/users/bmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmw/subscriptions","organizations_url":"https://api.github.com/users/bmw/orgs","repos_url":"https://api.github.com/users/bmw/repos","events_url":"https://api.github.com/users/bmw/events{/privacy}","received_events_url":"https://api.github.com/users/bmw/received_events","type":"User","site_admin":false},"assignees":[{"login":"bmw","id":6504915,"avatar_url":"https://avatars3.githubusercontent.com/u/6504915?v=3","gravatar_id":"","url":"https://api.github.com/users/bmw","html_url":"https://github.com/bmw","followers_url":"https://api.github.com/users/bmw/followers","following_url":"https://api.github.com/users/bmw/following{/other_user}","gists_url":"https://api.github.com/users/bmw/gists{/gist_id}","starred_url":"https://api.github.com/users/bmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmw/subscriptions","organizations_url":"https://api.github.com/users/bmw/orgs","repos_url":"https://api.github.com/users/bmw/repos","events_url":"https://api.github.com/users/bmw/events{/privacy}","received_events_url":"https://api.github.com/users/bmw/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/certbot/certbot/milestones/37","html_url":"https://github.com/certbot/certbot/milestone/37","labels_url":"https://api.github.com/repos/certbot/certbot/milestones/37/labels","id":2456283,"number":37,"title":"0.15.0","description":"","creator":{"login":"bmw","id":6504915,"avatar_url":"https://avatars3.githubusercontent.com/u/6504915?v=3","gravatar_id":"","url":"https://api.github.com/users/bmw","html_url":"https://github.com/bmw","followers_url":"https://api.github.com/users/bmw/followers","following_url":"https://api.github.com/users/bmw/following{/other_user}","gists_url":"https://api.github.com/users/bmw/gists{/gist_id}","starred_url":"https://api.github.com/users/bmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmw/subscriptions","organizations_url":"https://api.github.com/users/bmw/orgs","repos_url":"https://api.github.com/users/bmw/repos","events_url":"https://api.github.com/users/bmw/events{/privacy}","received_events_url":"https://api.github.com/users/bmw/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":10,"state":"open","created_at":"2017-04-13T21:34:30Z","updated_at":"2017-05-18T23:04:50Z","due_on":"2017-06-07T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/certbot/certbot/pulls/4691/commits","review_comments_url":"https://api.github.com/repos/certbot/certbot/pulls/4691/comments","review_comment_url":"https://api.github.com/repos/certbot/certbot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/certbot/certbot/issues/4691/comments","statuses_url":"https://api.github.com/repos/certbot/certbot/statuses/6250ad2f15af244b19d3b6b3d133b8f80f846e69","head":{"label":"certbot:fix-defaults","ref":"fix-defaults","sha":"6250ad2f15af244b19d3b6b3d133b8f80f846e69","user":{"login":"certbot","id":17889013,"avatar_url":"https://avatars1.githubusercontent.com/u/17889013?v=3","gravatar_id":"","url":"https://api.github.com/users/certbot","html_url":"https://github.com/certbot","followers_url":"https://api.github.com/users/certbot/followers","following_url":"https://api.github.com/users/certbot/following{/other_user}","gists_url":"https://api.github.com/users/certbot/gists{/gist_id}","starred_url":"https://api.github.com/users/certbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/certbot/subscriptions","organizations_url":"https://api.github.com/users/certbot/orgs","repos_url":"https://api.github.com/users/certbot/repos","events_url":"https://api.github.com/users/certbot/events{/privacy}","received_events_url":"https://api.github.com/users/certbot/received_events","type":"Organization","site_admin":false},"repo":{"id":26516210,"name":"certbot","full_name":"certbot/certbot","owner":{"login":"certbot","id":17889013,"avatar_url":"https://avatars1.githubusercontent.com/u/17889013?v=3","gravatar_id":"","url":"https://api.github.com/users/certbot","html_url":"https://github.com/certbot","followers_url":"https://api.github.com/users/certbot/followers","following_url":"https://api.github.com/users/certbot/following{/other_user}","gists_url":"https://api.github.com/users/certbot/gists{/gist_id}","starred_url":"https://api.github.com/users/certbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/certbot/subscriptions","organizations_url":"https://api.github.com/users/certbot/orgs","repos_url":"https://api.github.com/users/certbot/repos","events_url":"https://api.github.com/users/certbot/events{/privacy}","received_events_url":"https://api.github.com/users/certbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/certbot/certbot","description":"Certbot, previously the Let's Encrypt Client, is EFF's tool to obtain certs from Let's Encrypt, and (optionally) auto-enable HTTPS on your server.  It can also act as a client for any other CA that uses the ACME protocol.","fork":false,"url":"https://api.github.com/repos/certbot/certbot","forks_url":"https://api.github.com/repos/certbot/certbot/forks","keys_url":"https://api.github.com/repos/certbot/certbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/certbot/certbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/certbot/certbot/teams","hooks_url":"https://api.github.com/repos/certbot/certbot/hooks","issue_events_url":"https://api.github.com/repos/certbot/certbot/issues/events{/number}","events_url":"https://api.github.com/repos/certbot/certbot/events","assignees_url":"https://api.github.com/repos/certbot/certbot/assignees{/user}","branches_url":"https://api.github.com/repos/certbot/certbot/branches{/branch}","tags_url":"https://api.github.com/repos/certbot/certbot/tags","blobs_url":"https://api.github.com/repos/certbot/certbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/certbot/certbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/certbot/certbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/certbot/certbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/certbot/certbot/statuses/{sha}","languages_url":"https://api.github.com/repos/certbot/certbot/languages","stargazers_url":"https://api.github.com/repos/certbot/certbot/stargazers","contributors_url":"https://api.github.com/repos/certbot/certbot/contributors","subscribers_url":"https://api.github.com/repos/certbot/certbot/subscribers","subscription_url":"https://api.github.com/repos/certbot/certbot/subscription","commits_url":"https://api.github.com/repos/certbot/certbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/certbot/certbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/certbot/certbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/certbot/certbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/certbot/certbot/contents/{+path}","compare_url":"https://api.github.com/repos/certbot/certbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/certbot/certbot/merges","archive_url":"https://api.github.com/repos/certbot/certbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/certbot/certbot/downloads","issues_url":"https://api.github.com/repos/certbot/certbot/issues{/number}","pulls_url":"https://api.github.com/repos/certbot/certbot/pulls{/number}","milestones_url":"https://api.github.com/repos/certbot/certbot/milestones{/number}","notifications_url":"https://api.github.com/repos/certbot/certbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/certbot/certbot/labels{/name}","releases_url":"https://api.github.com/repos/certbot/certbot/releases{/id}","deployments_url":"https://api.github.com/repos/certbot/certbot/deployments","created_at":"2014-11-12T02:52:20Z","updated_at":"2017-05-19T14:37:25Z","pushed_at":"2017-05-19T19:53:11Z","git_url":"git://github.com/certbot/certbot.git","ssh_url":"git@github.com:certbot/certbot.git","clone_url":"https://github.com/certbot/certbot.git","svn_url":"https://github.com/certbot/certbot","homepage":"","size":14121,"stargazers_count":18526,"watchers_count":18526,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1657,"mirror_url":null,"open_issues_count":849,"forks":1657,"open_issues":849,"watchers":18526,"default_branch":"master"}},"base":{"label":"certbot:master","ref":"master","sha":"7da53819682fe1b320e0e2890d4cc4be0a637303","user":{"login":"certbot","id":17889013,"avatar_url":"https://avatars1.githubusercontent.com/u/17889013?v=3","gravatar_id":"","url":"https://api.github.com/users/certbot","html_url":"https://github.com/certbot","followers_url":"https://api.github.com/users/certbot/followers","following_url":"https://api.github.com/users/certbot/following{/other_user}","gists_url":"https://api.github.com/users/certbot/gists{/gist_id}","starred_url":"https://api.github.com/users/certbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/certbot/subscriptions","organizations_url":"https://api.github.com/users/certbot/orgs","repos_url":"https://api.github.com/users/certbot/repos","events_url":"https://api.github.com/users/certbot/events{/privacy}","received_events_url":"https://api.github.com/users/certbot/received_events","type":"Organization","site_admin":false},"repo":{"id":26516210,"name":"certbot","full_name":"certbot/certbot","owner":{"login":"certbot","id":17889013,"avatar_url":"https://avatars1.githubusercontent.com/u/17889013?v=3","gravatar_id":"","url":"https://api.github.com/users/certbot","html_url":"https://github.com/certbot","followers_url":"https://api.github.com/users/certbot/followers","following_url":"https://api.github.com/users/certbot/following{/other_user}","gists_url":"https://api.github.com/users/certbot/gists{/gist_id}","starred_url":"https://api.github.com/users/certbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/certbot/subscriptions","organizations_url":"https://api.github.com/users/certbot/orgs","repos_url":"https://api.github.com/users/certbot/repos","events_url":"https://api.github.com/users/certbot/events{/privacy}","received_events_url":"https://api.github.com/users/certbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/certbot/certbot","description":"Certbot, previously the Let's Encrypt Client, is EFF's tool to obtain certs from Let's Encrypt, and (optionally) auto-enable HTTPS on your server.  It can also act as a client for any other CA that uses the ACME protocol.","fork":false,"url":"https://api.github.com/repos/certbot/certbot","forks_url":"https://api.github.com/repos/certbot/certbot/forks","keys_url":"https://api.github.com/repos/certbot/certbot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/certbot/certbot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/certbot/certbot/teams","hooks_url":"https://api.github.com/repos/certbot/certbot/hooks","issue_events_url":"https://api.github.com/repos/certbot/certbot/issues/events{/number}","events_url":"https://api.github.com/repos/certbot/certbot/events","assignees_url":"https://api.github.com/repos/certbot/certbot/assignees{/user}","branches_url":"https://api.github.com/repos/certbot/certbot/branches{/branch}","tags_url":"https://api.github.com/repos/certbot/certbot/tags","blobs_url":"https://api.github.com/repos/certbot/certbot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/certbot/certbot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/certbot/certbot/git/refs{/sha}","trees_url":"https://api.github.com/repos/certbot/certbot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/certbot/certbot/statuses/{sha}","languages_url":"https://api.github.com/repos/certbot/certbot/languages","stargazers_url":"https://api.github.com/repos/certbot/certbot/stargazers","contributors_url":"https://api.github.com/repos/certbot/certbot/contributors","subscribers_url":"https://api.github.com/repos/certbot/certbot/subscribers","subscription_url":"https://api.github.com/repos/certbot/certbot/subscription","commits_url":"https://api.github.com/repos/certbot/certbot/commits{/sha}","git_commits_url":"https://api.github.com/repos/certbot/certbot/git/commits{/sha}","comments_url":"https://api.github.com/repos/certbot/certbot/comments{/number}","issue_comment_url":"https://api.github.com/repos/certbot/certbot/issues/comments{/number}","contents_url":"https://api.github.com/repos/certbot/certbot/contents/{+path}","compare_url":"https://api.github.com/repos/certbot/certbot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/certbot/certbot/merges","archive_url":"https://api.github.com/repos/certbot/certbot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/certbot/certbot/downloads","issues_url":"https://api.github.com/repos/certbot/certbot/issues{/number}","pulls_url":"https://api.github.com/repos/certbot/certbot/pulls{/number}","milestones_url":"https://api.github.com/repos/certbot/certbot/milestones{/number}","notifications_url":"https://api.github.com/repos/certbot/certbot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/certbot/certbot/labels{/name}","releases_url":"https://api.github.com/repos/certbot/certbot/releases{/id}","deployments_url":"https://api.github.com/repos/certbot/certbot/deployments","created_at":"2014-11-12T02:52:20Z","updated_at":"2017-05-19T14:37:25Z","pushed_at":"2017-05-19T19:53:11Z","git_url":"git://github.com/certbot/certbot.git","ssh_url":"git@github.com:certbot/certbot.git","clone_url":"https://github.com/certbot/certbot.git","svn_url":"https://github.com/certbot/certbot","homepage":"","size":14121,"stargazers_count":18526,"watchers_count":18526,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1657,"mirror_url":null,"open_issues_count":849,"forks":1657,"open_issues":849,"watchers":18526,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/certbot/certbot/pulls/4691"},"html":{"href":"https://github.com/certbot/certbot/pull/4691"},"issue":{"href":"https://api.github.com/repos/certbot/certbot/issues/4691"},"comments":{"href":"https://api.github.com/repos/certbot/certbot/issues/4691/comments"},"review_comments":{"href":"https://api.github.com/repos/certbot/certbot/pulls/4691/comments"},"review_comment":{"href":"https://api.github.com/repos/certbot/certbot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/certbot/certbot/pulls/4691/commits"},"statuses":{"href":"https://api.github.com/repos/certbot/certbot/statuses/6250ad2f15af244b19d3b6b3d133b8f80f846e69"}}}}
{"actor":{"display_login":"bmw"}}