{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/171859625","pull_request_review_id":100788539,"id":171859625,"diff_hunk":"@@ -503,6 +503,9 @@ def main():\n         else:\n             module.fail_json(msg='%s is not installed, and install_python_apt is False' % PYTHON_APT)\n \n+    if repo is None:\n+        module.fail_json(msg='Attribute \\'repo\\' is set to an empty value')","path":"lib/ansible/modules/packaging/os/apt_repository.py","position":5,"original_position":5,"commit_id":"d7aed6ae3734d65164f449da4b89b5db64b3a567","original_commit_id":"d7aed6ae3734d65164f449da4b89b5db64b3a567","user":{"login":"webknjaz","id":578543,"avatar_url":"https://avatars2.githubusercontent.com/u/578543?v=4","gravatar_id":"","url":"https://api.github.com/users/webknjaz","html_url":"https://github.com/webknjaz","followers_url":"https://api.github.com/users/webknjaz/followers","following_url":"https://api.github.com/users/webknjaz/following{/other_user}","gists_url":"https://api.github.com/users/webknjaz/gists{/gist_id}","starred_url":"https://api.github.com/users/webknjaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webknjaz/subscriptions","organizations_url":"https://api.github.com/users/webknjaz/orgs","repos_url":"https://api.github.com/users/webknjaz/repos","events_url":"https://api.github.com/users/webknjaz/events{/privacy}","received_events_url":"https://api.github.com/users/webknjaz/received_events","type":"User","site_admin":false},"body":"I think, it is better to be imperative and ask the user to fix this in a certain way. Like adding \"Please set it to non-empty string\" or so. It is good UX to be user-friendly and announce the expectations.","created_at":"2018-03-02T14:25:35Z","updated_at":"2018-03-02T14:26:05Z","html_url":"https://github.com/ansible/ansible/pull/36944#discussion_r171859625","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/36944","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/171859625"},"html":{"href":"https://github.com/ansible/ansible/pull/36944#discussion_r171859625"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/36944"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/36944","id":172503509,"html_url":"https://github.com/ansible/ansible/pull/36944","diff_url":"https://github.com/ansible/ansible/pull/36944.diff","patch_url":"https://github.com/ansible/ansible/pull/36944.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/36944","number":36944,"state":"open","locked":false,"title":"apt_repository: check attribute repo for None value","user":{"login":"julienvey","id":455944,"avatar_url":"https://avatars3.githubusercontent.com/u/455944?v=4","gravatar_id":"","url":"https://api.github.com/users/julienvey","html_url":"https://github.com/julienvey","followers_url":"https://api.github.com/users/julienvey/followers","following_url":"https://api.github.com/users/julienvey/following{/other_user}","gists_url":"https://api.github.com/users/julienvey/gists{/gist_id}","starred_url":"https://api.github.com/users/julienvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienvey/subscriptions","organizations_url":"https://api.github.com/users/julienvey/orgs","repos_url":"https://api.github.com/users/julienvey/repos","events_url":"https://api.github.com/users/julienvey/events{/privacy}","received_events_url":"https://api.github.com/users/julienvey/received_events","type":"User","site_admin":false},"body":"##### SUMMARY\r\n<!--- Describe the change, including rationale and design decisions -->\r\nFail properly when `repo` is set, but not filled, which results in a `None` in the `apt_repository` module\r\n\r\nFixes #36926\r\n\r\n<!---\r\nIf you are fixing an existing issue, please include \"Fixes #nnn\" in your\r\ncommit message and your description; but you should still explain what\r\nthe change does.\r\n-->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the module, plugin, module or task -->\r\napt_repository\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\n2.6.0\r\n```\r\n\r\n\r\n##### ADDITIONAL INFORMATION\r\n<!---\r\nInclude additional information to help people understand the change here.\r\nFor bugs that don't have a linked bug report, a step-by-step reproduction\r\nof the problem is helpful.\r\n  -->\r\nI'm wondering if instead of catching the error in the module, ansible shouldn't fail earlier. As the attribute is described as `required`, i think setting it to an empty value should fail. But this might have a bigger impact than just the `apt_repository` module\r\n\r\n","created_at":"2018-03-02T13:32:11Z","updated_at":"2018-03-02T14:26:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1547bff1acb8c7b88f3bc3341ca0f9ec64aa6f2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/36944/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/36944/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/36944/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/d7aed6ae3734d65164f449da4b89b5db64b3a567","head":{"label":"julienvey:ansible36926","ref":"ansible36926","sha":"d7aed6ae3734d65164f449da4b89b5db64b3a567","user":{"login":"julienvey","id":455944,"avatar_url":"https://avatars3.githubusercontent.com/u/455944?v=4","gravatar_id":"","url":"https://api.github.com/users/julienvey","html_url":"https://github.com/julienvey","followers_url":"https://api.github.com/users/julienvey/followers","following_url":"https://api.github.com/users/julienvey/following{/other_user}","gists_url":"https://api.github.com/users/julienvey/gists{/gist_id}","starred_url":"https://api.github.com/users/julienvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienvey/subscriptions","organizations_url":"https://api.github.com/users/julienvey/orgs","repos_url":"https://api.github.com/users/julienvey/repos","events_url":"https://api.github.com/users/julienvey/events{/privacy}","received_events_url":"https://api.github.com/users/julienvey/received_events","type":"User","site_admin":false},"repo":{"id":95780116,"name":"ansible","full_name":"julienvey/ansible","owner":{"login":"julienvey","id":455944,"avatar_url":"https://avatars3.githubusercontent.com/u/455944?v=4","gravatar_id":"","url":"https://api.github.com/users/julienvey","html_url":"https://github.com/julienvey","followers_url":"https://api.github.com/users/julienvey/followers","following_url":"https://api.github.com/users/julienvey/following{/other_user}","gists_url":"https://api.github.com/users/julienvey/gists{/gist_id}","starred_url":"https://api.github.com/users/julienvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienvey/subscriptions","organizations_url":"https://api.github.com/users/julienvey/orgs","repos_url":"https://api.github.com/users/julienvey/repos","events_url":"https://api.github.com/users/julienvey/events{/privacy}","received_events_url":"https://api.github.com/users/julienvey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/julienvey/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/julienvey/ansible","forks_url":"https://api.github.com/repos/julienvey/ansible/forks","keys_url":"https://api.github.com/repos/julienvey/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/julienvey/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/julienvey/ansible/teams","hooks_url":"https://api.github.com/repos/julienvey/ansible/hooks","issue_events_url":"https://api.github.com/repos/julienvey/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/julienvey/ansible/events","assignees_url":"https://api.github.com/repos/julienvey/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/julienvey/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/julienvey/ansible/tags","blobs_url":"https://api.github.com/repos/julienvey/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/julienvey/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/julienvey/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/julienvey/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/julienvey/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/julienvey/ansible/languages","stargazers_url":"https://api.github.com/repos/julienvey/ansible/stargazers","contributors_url":"https://api.github.com/repos/julienvey/ansible/contributors","subscribers_url":"https://api.github.com/repos/julienvey/ansible/subscribers","subscription_url":"https://api.github.com/repos/julienvey/ansible/subscription","commits_url":"https://api.github.com/repos/julienvey/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/julienvey/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/julienvey/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/julienvey/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/julienvey/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/julienvey/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/julienvey/ansible/merges","archive_url":"https://api.github.com/repos/julienvey/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/julienvey/ansible/downloads","issues_url":"https://api.github.com/repos/julienvey/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/julienvey/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/julienvey/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/julienvey/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/julienvey/ansible/labels{/name}","releases_url":"https://api.github.com/repos/julienvey/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/julienvey/ansible/deployments","created_at":"2017-06-29T13:23:25Z","updated_at":"2017-06-29T13:23:48Z","pushed_at":"2018-03-02T13:49:58Z","git_url":"git://github.com/julienvey/ansible.git","ssh_url":"git@github.com:julienvey/ansible.git","clone_url":"https://github.com/julienvey/ansible.git","svn_url":"https://github.com/julienvey/ansible","homepage":"http://ansible.com/","size":117621,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"83c3561ee517ac5b2b90534f369902cae90b2da6","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars2.githubusercontent.com/u/1507452?v=4","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://avatars2.githubusercontent.com/u/1507452?v=4","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":"2018-03-02T13:27:04Z","pushed_at":"2018-03-02T14:08:06Z","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":"https://www.ansible.com/","size":120159,"stargazers_count":28741,"watchers_count":28741,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10384,"mirror_url":null,"archived":false,"open_issues_count":4833,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":10384,"open_issues":4833,"watchers":28741,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/36944"},"html":{"href":"https://github.com/ansible/ansible/pull/36944"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/36944"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/36944/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/36944/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/36944/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/d7aed6ae3734d65164f449da4b89b5db64b3a567"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"webknjaz"}}