{"action":"closed","number":17156,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/17156","id":82016566,"html_url":"https://github.com/ansible/ansible/pull/17156","diff_url":"https://github.com/ansible/ansible/pull/17156.diff","patch_url":"https://github.com/ansible/ansible/pull/17156.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/17156","number":17156,"state":"closed","locked":false,"title":"[ansible-doc cmd]  Declare 'choices' and 'default' as empty strings.","user":{"login":"supertom","id":46346,"avatar_url":"https://avatars.githubusercontent.com/u/46346?v=3","gravatar_id":"","url":"https://api.github.com/users/supertom","html_url":"https://github.com/supertom","followers_url":"https://api.github.com/users/supertom/followers","following_url":"https://api.github.com/users/supertom/following{/other_user}","gists_url":"https://api.github.com/users/supertom/gists{/gist_id}","starred_url":"https://api.github.com/users/supertom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supertom/subscriptions","organizations_url":"https://api.github.com/users/supertom/orgs","repos_url":"https://api.github.com/users/supertom/repos","events_url":"https://api.github.com/users/supertom/events{/privacy}","received_events_url":"https://api.github.com/users/supertom/received_events","type":"User","site_admin":false},"body":"##### ISSUE TYPE\n\n<!--- Pick one below and delete the rest: -->\n- Bugfix Pull Request\n##### COMPONENT NAME\n\nansible/ansible\n##### ANSIBLE VERSION\n\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\n\n```\nansible 2.2.0 (ansible-doc 4173919af7) last updated 2016/08/19 17:21:03 (GMT +000)\n  lib/ansible/modules/core: (detached HEAD 91a839f1e3) last updated 2016/08/19 17:11:10 (GMT +000)\n  lib/ansible/modules/extras: (detached HEAD 1aeb9f8a8c) last updated 2016/08/19 17:11:12 (GMT +000)\n  config file = /home/supertom/.ansible.cfg\n  configured module search path = Default w/o overrides\n\nansible-doc 2.2.0 (ansible-doc 4173919af7) last updated 2016/08/19 17:21:03 (GMT +000)\n  lib/ansible/modules/core: (detached HEAD 91a839f1e3) last updated 2016/08/19 17:11:10 (GMT +000)\n  lib/ansible/modules/extras: (detached HEAD 1aeb9f8a8c) last updated 2016/08/19 17:11:12 (GMT +000)\n  config file = /home/supertom/.ansible.cfg\n  configured module search path = Default w/o overrides\n```\n##### SUMMARY\n\n<!--- Describe the change, including rationale and design decisions -->\n\nWhen running ansible-doc from devel, I receive an UnboundLocalError if 'choices' is not set for an option.\n\n```\nansible-doc gce\nTraceback (most recent call last):\n  File \"/home/supertom/virts/ansible-doc/code/ansible/lib/ansible/cli/doc.py\", line 130, in run\n    text += self.get_man_text(doc)\n  File \"/home/supertom/virts/ansible-doc/code/ansible/lib/ansible/cli/doc.py\", line 287, in get_man_text\n    text.append(textwrap.fill(CLI.tty_ify(choices + default), limit, initial_indent=opt_indent, subsequent_indent=opt_indent))\nUnboundLocalError: local variable 'choices' referenced before assignment\n\n```\n\nThis declares the variables so they can be concatenated correctly.\n\nIt also has the added side-benefit of not printing \"Choices\" text for options that don't have choices.  See this snippet for the ec2 module as an example:\n## Before change:\n\n```\nansible-doc ec2\n- exact_count\n        An integer value which indicates how many instances that match the 'count_tag' parameter should be running. Instances are either\n        created or terminated based on this value.\n        (Choices: yes, no)[Default: None]\n```\n## After change\n\n```\nansible-doc ec2\n- exact_count\n        An integer value which indicates how many instances that match the 'count_tag' parameter should be running. Instances are either\n        created or terminated based on this value.\n        [Default: None]\n```\n","created_at":"2016-08-19T17:30:04Z","updated_at":"2016-11-08T21:09:38Z","closed_at":"2016-11-08T21:09:38Z","merged_at":null,"merge_commit_sha":"f79638cf4e81c5dbc62fb78da25ffcfb573c4181","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/17156/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/17156/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/17156/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/4173919af7bcf1a7f45da8dd15a3ae772ceba83c","head":{"label":"supertom:ansible-doc","ref":"ansible-doc","sha":"4173919af7bcf1a7f45da8dd15a3ae772ceba83c","user":{"login":"supertom","id":46346,"avatar_url":"https://avatars.githubusercontent.com/u/46346?v=3","gravatar_id":"","url":"https://api.github.com/users/supertom","html_url":"https://github.com/supertom","followers_url":"https://api.github.com/users/supertom/followers","following_url":"https://api.github.com/users/supertom/following{/other_user}","gists_url":"https://api.github.com/users/supertom/gists{/gist_id}","starred_url":"https://api.github.com/users/supertom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supertom/subscriptions","organizations_url":"https://api.github.com/users/supertom/orgs","repos_url":"https://api.github.com/users/supertom/repos","events_url":"https://api.github.com/users/supertom/events{/privacy}","received_events_url":"https://api.github.com/users/supertom/received_events","type":"User","site_admin":false},"repo":{"id":59767072,"name":"ansible","full_name":"supertom/ansible","owner":{"login":"supertom","id":46346,"avatar_url":"https://avatars.githubusercontent.com/u/46346?v=3","gravatar_id":"","url":"https://api.github.com/users/supertom","html_url":"https://github.com/supertom","followers_url":"https://api.github.com/users/supertom/followers","following_url":"https://api.github.com/users/supertom/following{/other_user}","gists_url":"https://api.github.com/users/supertom/gists{/gist_id}","starred_url":"https://api.github.com/users/supertom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/supertom/subscriptions","organizations_url":"https://api.github.com/users/supertom/orgs","repos_url":"https://api.github.com/users/supertom/repos","events_url":"https://api.github.com/users/supertom/events{/privacy}","received_events_url":"https://api.github.com/users/supertom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/supertom/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":true,"url":"https://api.github.com/repos/supertom/ansible","forks_url":"https://api.github.com/repos/supertom/ansible/forks","keys_url":"https://api.github.com/repos/supertom/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/supertom/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/supertom/ansible/teams","hooks_url":"https://api.github.com/repos/supertom/ansible/hooks","issue_events_url":"https://api.github.com/repos/supertom/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/supertom/ansible/events","assignees_url":"https://api.github.com/repos/supertom/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/supertom/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/supertom/ansible/tags","blobs_url":"https://api.github.com/repos/supertom/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/supertom/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/supertom/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/supertom/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/supertom/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/supertom/ansible/languages","stargazers_url":"https://api.github.com/repos/supertom/ansible/stargazers","contributors_url":"https://api.github.com/repos/supertom/ansible/contributors","subscribers_url":"https://api.github.com/repos/supertom/ansible/subscribers","subscription_url":"https://api.github.com/repos/supertom/ansible/subscription","commits_url":"https://api.github.com/repos/supertom/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/supertom/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/supertom/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/supertom/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/supertom/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/supertom/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/supertom/ansible/merges","archive_url":"https://api.github.com/repos/supertom/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/supertom/ansible/downloads","issues_url":"https://api.github.com/repos/supertom/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/supertom/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/supertom/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/supertom/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/supertom/ansible/labels{/name}","releases_url":"https://api.github.com/repos/supertom/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/supertom/ansible/deployments","created_at":"2016-05-26T16:42:50Z","updated_at":"2016-05-26T16:42:58Z","pushed_at":"2016-11-08T17:28:27Z","git_url":"git://github.com/supertom/ansible.git","ssh_url":"git@github.com:supertom/ansible.git","clone_url":"https://github.com/supertom/ansible.git","svn_url":"https://github.com/supertom/ansible","homepage":"http://ansible.com/","size":38285,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"04bd6a3619c84d39faa220893dab5266f32665ce","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2016-11-08T20:44:52Z","pushed_at":"2016-11-08T18:12:22Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"http://ansible.com/","size":76877,"stargazers_count":19664,"watchers_count":19664,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6001,"mirror_url":null,"open_issues_count":1603,"forks":6001,"open_issues":1603,"watchers":19664,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17156"},"html":{"href":"https://github.com/ansible/ansible/pull/17156"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/17156"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/17156/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17156/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17156/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/4173919af7bcf1a7f45da8dd15a3ae772ceba83c"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":1,"review_comments":0,"commits":1,"additions":1,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"bcoca"}}