{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/79278713","id":79278713,"diff_hunk":"@@ -73,91 +75,163 @@ def _parse_parameters(term):\n     params['chars'] = params.get('chars', None)\n     if params['chars']:\n         tmp_chars = []\n-        if ',,' in params['chars']:\n+        if u',,' in params['chars']:\n             tmp_chars.append(u',')\n-        tmp_chars.extend(c for c in params['chars'].replace(',,', ',').split(',') if c)\n+        tmp_chars.extend(c for c in params['chars'].replace(u',,', u',').split(u',') if c)\n         params['chars'] = tmp_chars\n     else:\n         # Default chars for password\n-        params['chars'] = ['ascii_letters', 'digits', \".,:-_\"]\n+        params['chars'] = [u'ascii_letters', u'digits', u\".,:-_\"]\n \n     return relpath, params\n \n+def _random_password(length=DEFAULT_LENGTH, chars=None):\n+    '''\n+    Return a random password string of length containing only chars.\n+    NOTE: this was moved from the old ansible utils code, as nothing\n+          else appeared to use it.\n+    '''\n+\n+    # hate how python implements asserts. Our text strategy says that we\n+    # should never be passing byte strings around unless the function\n+    # explicitly takes a byte string as its argument.  Therefore if we get\n+    # a byte string here it means that the problem is in the calling code.\n+    # Asserts would be perfect for this if they were disabled by default.\n+    # Alas, in python, they're active by default; only turned off if\n+    # python is run with optimization.\n+    chars = chars or to_text(C.DEFAULT_PASSWORD_CHARS)","path":"lib/ansible/plugins/lookup/password.py","position":55,"original_position":55,"commit_id":"805896c4e2b18ce027aac18742757d8b0fd2181c","original_commit_id":"805896c4e2b18ce027aac18742757d8b0fd2181c","user":{"login":"abadger","id":209242,"avatar_url":"https://avatars.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"body":"Convert C.DEFAULT_PASSWORD_CHARS into text in lib/ansible/constants,py instead.","created_at":"2016-09-17T07:51:27Z","updated_at":"2016-09-17T07:51:27Z","html_url":"https://github.com/ansible/ansible/pull/17465#discussion_r79278713","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/17465","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/79278713"},"html":{"href":"https://github.com/ansible/ansible/pull/17465#discussion_r79278713"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17465"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/17465","id":84529737,"html_url":"https://github.com/ansible/ansible/pull/17465","diff_url":"https://github.com/ansible/ansible/pull/17465.diff","patch_url":"https://github.com/ansible/ansible/pull/17465.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/17465","number":17465,"state":"open","locked":false,"title":"Improve unit testing of 'password' lookup","user":{"login":"alikins","id":15162,"avatar_url":"https://avatars.githubusercontent.com/u/15162?v=3","gravatar_id":"","url":"https://api.github.com/users/alikins","html_url":"https://github.com/alikins","followers_url":"https://api.github.com/users/alikins/followers","following_url":"https://api.github.com/users/alikins/following{/other_user}","gists_url":"https://api.github.com/users/alikins/gists{/gist_id}","starred_url":"https://api.github.com/users/alikins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alikins/subscriptions","organizations_url":"https://api.github.com/users/alikins/orgs","repos_url":"https://api.github.com/users/alikins/repos","events_url":"https://api.github.com/users/alikins/events{/privacy}","received_events_url":"https://api.github.com/users/alikins/received_events","type":"User","site_admin":false},"body":"##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bugfix Pull Request\r\n\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the plugin/module/task -->\r\nlib/ansible/plugins/lookup/password.py\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.2.0 (password_lookup ab5bd4a9eb) last updated 2016/09/08 14:30:44 (GMT -400)\r\n  lib/ansible/modules/core: (detached HEAD db38f0c876) last updated 2016/09/07 12:50:14 (GMT -400)\r\n  lib/ansible/modules/extras: (detached HEAD 8bfdcfcab2) last updated 2016/09/07 12:50:14 (GMT -400)\r\n  config file = /home/adrian/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n\r\n```\r\n\r\n##### SUMMARY\r\nWas attempting to reproduce https://github.com/ansible/ansible/issues/17461 with\r\nunit tests, and these were changes to make the module a little easier to test. ( Note\r\nthis doesn't fix https://github.com/ansible/ansible/issues/17461)\r\n\r\nThe tests showed some UnicodeErrors for the\r\ncases where the 'chars' param include unicode,\r\ncausing the 'getattr(string, c, c)' to fail.\r\nSo the candidate char generation code try/excepts\r\nUnicodeErrors there now.\r\n\r\nSome refactoring of the password.py module to make\r\nit easier to test, and some new tests that cover more\r\nof the password and salt generation.","created_at":"2016-09-08T18:33:51Z","updated_at":"2016-09-17T07:51:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"668bc46903df02c0ed3c50a9ed17e19a7f3e91d3","assignee":{"login":"abadger","id":209242,"avatar_url":"https://avatars.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"assignees":[{"login":"abadger","id":209242,"avatar_url":"https://avatars.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ansible/ansible/milestones/8","html_url":"https://github.com/ansible/ansible/milestones/2.2.0","labels_url":"https://api.github.com/repos/ansible/ansible/milestones/8/labels","id":1702615,"number":8,"title":"2.2.0","description":"","creator":{"login":"sivel","id":39340,"avatar_url":"https://avatars.githubusercontent.com/u/39340?v=3","gravatar_id":"","url":"https://api.github.com/users/sivel","html_url":"https://github.com/sivel","followers_url":"https://api.github.com/users/sivel/followers","following_url":"https://api.github.com/users/sivel/following{/other_user}","gists_url":"https://api.github.com/users/sivel/gists{/gist_id}","starred_url":"https://api.github.com/users/sivel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sivel/subscriptions","organizations_url":"https://api.github.com/users/sivel/orgs","repos_url":"https://api.github.com/users/sivel/repos","events_url":"https://api.github.com/users/sivel/events{/privacy}","received_events_url":"https://api.github.com/users/sivel/received_events","type":"User","site_admin":false},"open_issues":171,"closed_issues":229,"state":"open","created_at":"2016-04-12T23:10:49Z","updated_at":"2016-09-17T07:45:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/17465/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/17465/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/17465/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/805896c4e2b18ce027aac18742757d8b0fd2181c","head":{"label":"alikins:password_lookup","ref":"password_lookup","sha":"805896c4e2b18ce027aac18742757d8b0fd2181c","user":{"login":"alikins","id":15162,"avatar_url":"https://avatars.githubusercontent.com/u/15162?v=3","gravatar_id":"","url":"https://api.github.com/users/alikins","html_url":"https://github.com/alikins","followers_url":"https://api.github.com/users/alikins/followers","following_url":"https://api.github.com/users/alikins/following{/other_user}","gists_url":"https://api.github.com/users/alikins/gists{/gist_id}","starred_url":"https://api.github.com/users/alikins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alikins/subscriptions","organizations_url":"https://api.github.com/users/alikins/orgs","repos_url":"https://api.github.com/users/alikins/repos","events_url":"https://api.github.com/users/alikins/events{/privacy}","received_events_url":"https://api.github.com/users/alikins/received_events","type":"User","site_admin":false},"repo":{"id":54061420,"name":"ansible","full_name":"alikins/ansible","owner":{"login":"alikins","id":15162,"avatar_url":"https://avatars.githubusercontent.com/u/15162?v=3","gravatar_id":"","url":"https://api.github.com/users/alikins","html_url":"https://github.com/alikins","followers_url":"https://api.github.com/users/alikins/followers","following_url":"https://api.github.com/users/alikins/following{/other_user}","gists_url":"https://api.github.com/users/alikins/gists{/gist_id}","starred_url":"https://api.github.com/users/alikins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alikins/subscriptions","organizations_url":"https://api.github.com/users/alikins/orgs","repos_url":"https://api.github.com/users/alikins/repos","events_url":"https://api.github.com/users/alikins/events{/privacy}","received_events_url":"https://api.github.com/users/alikins/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alikins/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/alikins/ansible","forks_url":"https://api.github.com/repos/alikins/ansible/forks","keys_url":"https://api.github.com/repos/alikins/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alikins/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alikins/ansible/teams","hooks_url":"https://api.github.com/repos/alikins/ansible/hooks","issue_events_url":"https://api.github.com/repos/alikins/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/alikins/ansible/events","assignees_url":"https://api.github.com/repos/alikins/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/alikins/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/alikins/ansible/tags","blobs_url":"https://api.github.com/repos/alikins/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alikins/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alikins/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/alikins/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alikins/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/alikins/ansible/languages","stargazers_url":"https://api.github.com/repos/alikins/ansible/stargazers","contributors_url":"https://api.github.com/repos/alikins/ansible/contributors","subscribers_url":"https://api.github.com/repos/alikins/ansible/subscribers","subscription_url":"https://api.github.com/repos/alikins/ansible/subscription","commits_url":"https://api.github.com/repos/alikins/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/alikins/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/alikins/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/alikins/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/alikins/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/alikins/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alikins/ansible/merges","archive_url":"https://api.github.com/repos/alikins/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alikins/ansible/downloads","issues_url":"https://api.github.com/repos/alikins/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/alikins/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/alikins/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/alikins/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alikins/ansible/labels{/name}","releases_url":"https://api.github.com/repos/alikins/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/alikins/ansible/deployments","created_at":"2016-03-16T19:41:33Z","updated_at":"2016-05-10T14:08:41Z","pushed_at":"2016-09-17T00:15:20Z","git_url":"git://github.com/alikins/ansible.git","ssh_url":"git@github.com:alikins/ansible.git","clone_url":"https://github.com/alikins/ansible.git","svn_url":"https://github.com/alikins/ansible","homepage":"http://ansible.com/","size":38700,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"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":"29fda4be1eb73d3af4212997222b5e9ae0b03594","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-09-17T05:17:18Z","pushed_at":"2016-09-17T07:45:29Z","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":64270,"stargazers_count":18839,"watchers_count":18839,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5714,"mirror_url":null,"open_issues_count":1517,"forks":5714,"open_issues":1517,"watchers":18839,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17465"},"html":{"href":"https://github.com/ansible/ansible/pull/17465"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/17465"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/17465/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17465/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17465/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/805896c4e2b18ce027aac18742757d8b0fd2181c"}}}}
{"actor":{"display_login":"abadger"}}