{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3743","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3743/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3743/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3743/events","html_url":"https://github.com/ansible/ansible-modules-core/pull/3743","id":156838629,"number":3743,"title":"Fixes #3661 - Make use of conn_type variable so we can easily handle …","user":{"login":"ronnietaylor","id":113267,"avatar_url":"https://avatars.githubusercontent.com/u/113267?v=3","gravatar_id":"","url":"https://api.github.com/users/ronnietaylor","html_url":"https://github.com/ronnietaylor","followers_url":"https://api.github.com/users/ronnietaylor/followers","following_url":"https://api.github.com/users/ronnietaylor/following{/other_user}","gists_url":"https://api.github.com/users/ronnietaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/ronnietaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronnietaylor/subscriptions","organizations_url":"https://api.github.com/users/ronnietaylor/orgs","repos_url":"https://api.github.com/users/ronnietaylor/repos","events_url":"https://api.github.com/users/ronnietaylor/events{/privacy}","received_events_url":"https://api.github.com/users/ronnietaylor/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bugfix_pull_request","name":"bugfix_pull_request","color":"ded270"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/networking","name":"networking","color":"c7def8"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/shipit","name":"shipit","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-25T20:06:56Z","updated_at":"2016-05-27T16:26:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/pulls/3743","html_url":"https://github.com/ansible/ansible-modules-core/pull/3743","diff_url":"https://github.com/ansible/ansible-modules-core/pull/3743.diff","patch_url":"https://github.com/ansible/ansible-modules-core/pull/3743.patch"},"body":"##### ISSUE TYPE\r\n\r\n - Bugfix Pull Request\r\n\r\n\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.2.0 (devel d08fda9320) last updated 2016/05/24 21:03:58 (GMT -700)\r\n  lib/ansible/modules/core: (detached HEAD aa995806b9) last updated 2016/05/24 21:04:04 (GMT -700)\r\n  lib/ansible/modules/extras: (detached HEAD d1a4f703ce) last updated 2016/05/24 21:04:09 (GMT -700)\r\n  config file = /Users/ronnietaylor/Documents/Development/ansible-experiments/vangrants/ubuntu1404/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\n\r\nFixes #3661\r\n\r\nGoes with corresponding pull request: https://github.com/ansible/ansible/pull/15995\r\n\r\nMake use of new conn_type variable returned by fetch_url that contains the output from `urlparse.urlparse(url)` (i.e. 'ftp', 'http' or 'https').\r\n\r\nThis ultimately lets get_url check against something other than just HTTP status codes since successful FTP connections don't return status codes in the response headers like HTTP does. By passing along the connection type we can prevent incorrectly throwing errors for successful FTP connections.\r\n\r\nSince the parsing of the url already happens at this level then it seemed best to just capture it once and pass it through to get_url instead of parsing the url again later.\r\n\r\n\r\n\r\nThis new variable will contain a string like the following:\r\n```\r\n>>> conn_type\r\n'ftp'\r\n```\r\n\r\n… in the get_url module."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/222191608","html_url":"https://github.com/ansible/ansible-modules-core/pull/3743#issuecomment-222191608","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3743","id":222191608,"user":{"login":"ronnietaylor","id":113267,"avatar_url":"https://avatars.githubusercontent.com/u/113267?v=3","gravatar_id":"","url":"https://api.github.com/users/ronnietaylor","html_url":"https://github.com/ronnietaylor","followers_url":"https://api.github.com/users/ronnietaylor/followers","following_url":"https://api.github.com/users/ronnietaylor/following{/other_user}","gists_url":"https://api.github.com/users/ronnietaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/ronnietaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronnietaylor/subscriptions","organizations_url":"https://api.github.com/users/ronnietaylor/orgs","repos_url":"https://api.github.com/users/ronnietaylor/repos","events_url":"https://api.github.com/users/ronnietaylor/events{/privacy}","received_events_url":"https://api.github.com/users/ronnietaylor/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T16:26:22Z","updated_at":"2016-05-27T16:26:22Z","body":"Actually....I may have found a regression in my local repo after using this fix. \r\n\r\nA problem occurred in one of my other playbooks that uses the apt_key module. It threw an exception of \"too many values to unpack\".\r\n\r\nAs best I can tell this is because I changed the number of objects returned by fetch_url which is used by apt_key and other modules.\r\n\r\nSee the corresponding change here:\r\n\r\nhttps://github.com/ansible/ansible/pull/15995\r\n\r\nSo I'd like some feedback on a different tactic. I was originally trying to avoid parsing the url again within get_url since that is already done down in open_url. However, it seems now that parsing it again in get_url in order to set conn_type may a simpler way and avoids the side affects.\r\n\r\nLet me know what you think.\r\n\r\nThanks."}}
{"actor":{"display_login":"ronnietaylor"}}