{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/138402919","pull_request_review_id":62192937,"id":138402919,"diff_hunk":"@@ -96,57 +76,24 @@\n import json\n \n from ansible.module_utils.api import basic_auth_argument_spec\n-from ansible.module_utils.pycompat24 import get_exception\n-from ansible.module_utils.urls import open_url\n-\n from ansible.module_utils.basic import AnsibleModule\n-from ansible.module_utils.six.moves.urllib.error import HTTPError\n+from ansible.module_utils.netapp import request, eseries_host_argument_spec\n+from ansible.module_utils.pycompat24 import get_exception\n \n HEADERS = {\n     \"Content-Type\": \"application/json\",\n     \"Accept\": \"application/json\"\n }\n \n \n-def request(url, data=None, headers=None, method='GET', use_proxy=True,\n-            force=False, last_mod_time=None, timeout=10, validate_certs=True,\n-            url_username=None, url_password=None, http_agent=None, force_basic_auth=True, ignore_errors=False):\n-    try:\n-        r = open_url(url=url, data=data, headers=headers, method=method, use_proxy=use_proxy,\n-                     force=force, last_mod_time=last_mod_time, timeout=timeout, validate_certs=validate_certs,\n-                     url_username=url_username, url_password=url_password, http_agent=http_agent,\n-                     force_basic_auth=force_basic_auth)\n-    except HTTPError:\n-        err = get_exception()\n-        r = err.fp\n-\n-    try:\n-        raw_data = r.read()\n-        if raw_data:\n-            data = json.loads(raw_data)\n-        else:\n-            raw_data = None\n-    except:\n-        if ignore_errors:\n-            pass\n-        else:\n-            raise Exception(raw_data)\n-\n-    resp_code = r.getcode()\n-\n-    if resp_code >= 400 and not ignore_errors:\n-        raise Exception(resp_code, data)\n-    else:\n-        return resp_code, data\n-\n-\n-def get_host_and_group_map(module, ssid, api_url, user, pwd):\n+def get_host_and_group_map(module, ssid, api_url, user, pwd, validate_certs):\n     mapping = dict(host=dict(), group=dict())\n \n     hostgroups = 'storage-systems/%s/host-groups' % ssid\n     groups_url = api_url + hostgroups\n     try:\n-        hg_rc, hg_data = request(groups_url, headers=HEADERS, url_username=user, url_password=pwd)\n+        hg_rc, hg_data = request(groups_url, headers=HEADERS, url_username=user, url_password=pwd,","path":"lib/ansible/modules/storage/netapp/netapp_e_lun_mapping.py","position":112,"original_position":112,"commit_id":"a3097a860095d0c36740e30fc2680e42428a6834","original_commit_id":"a3097a860095d0c36740e30fc2680e42428a6834","user":{"login":"hulquest","id":4061574,"avatar_url":"https://avatars2.githubusercontent.com/u/4061574?v=4","gravatar_id":"","url":"https://api.github.com/users/hulquest","html_url":"https://github.com/hulquest","followers_url":"https://api.github.com/users/hulquest/followers","following_url":"https://api.github.com/users/hulquest/following{/other_user}","gists_url":"https://api.github.com/users/hulquest/gists{/gist_id}","starred_url":"https://api.github.com/users/hulquest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hulquest/subscriptions","organizations_url":"https://api.github.com/users/hulquest/orgs","repos_url":"https://api.github.com/users/hulquest/repos","events_url":"https://api.github.com/users/hulquest/events{/privacy}","received_events_url":"https://api.github.com/users/hulquest/received_events","type":"User","site_admin":false},"body":"Future improvement: Along the same line of thought as above, should we rename request to something like santricity_request?   Just trying to improve the readability.","created_at":"2017-09-12T16:38:21Z","updated_at":"2017-09-12T16:38:21Z","html_url":"https://github.com/ansible/ansible/pull/28294#discussion_r138402919","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/28294","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/138402919"},"html":{"href":"https://github.com/ansible/ansible/pull/28294#discussion_r138402919"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/28294"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/28294","id":136097343,"html_url":"https://github.com/ansible/ansible/pull/28294","diff_url":"https://github.com/ansible/ansible/pull/28294.diff","patch_url":"https://github.com/ansible/ansible/pull/28294.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/28294","number":28294,"state":"open","locked":false,"title":"Resolve issues with NetApp E-Series LunMapping module","user":{"login":"lmprice","id":1957930,"avatar_url":"https://avatars2.githubusercontent.com/u/1957930?v=4","gravatar_id":"","url":"https://api.github.com/users/lmprice","html_url":"https://github.com/lmprice","followers_url":"https://api.github.com/users/lmprice/followers","following_url":"https://api.github.com/users/lmprice/following{/other_user}","gists_url":"https://api.github.com/users/lmprice/gists{/gist_id}","starred_url":"https://api.github.com/users/lmprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmprice/subscriptions","organizations_url":"https://api.github.com/users/lmprice/orgs","repos_url":"https://api.github.com/users/lmprice/repos","events_url":"https://api.github.com/users/lmprice/events{/privacy}","received_events_url":"https://api.github.com/users/lmprice/received_events","type":"User","site_admin":false},"body":"##### SUMMARY\r\nResolve issues with the Lun Mapping module, including:\r\n\r\n* Remove a default value for the LUN number\r\n* Remove code that is provided by module_utils\r\n* Propagate validate_certs variable to the API requests\r\n\r\n##### ISSUE TYPE\r\n - Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\nnetapp_e_lun_mapping\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.4.0 (mapping a3097a8600) last updated 2017/08/16 18:52:12 (GMT +000)\r\n  config file = /home/ansible.cfg\r\n  configured module search path = [u'/home/lib/ansible/modules']\r\n  ansible python module location = /home/lib/ansible\r\n  executable location = /home/bin/ansible\r\n  python version = 2.7.13 (default, May  1 2017, 22:44:36) [GCC 4.9.2]\r\n```\r\n\r\n\r\n##### ADDITIONAL INFORMATION\r\nN/A\r\n","created_at":"2017-08-16T18:57:04Z","updated_at":"2017-09-12T16:38:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e2678595177a40dbd940aef7d9218ffed404424","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/28294/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/28294/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/28294/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/a3097a860095d0c36740e30fc2680e42428a6834","head":{"label":"lmprice:mapping","ref":"mapping","sha":"a3097a860095d0c36740e30fc2680e42428a6834","user":{"login":"lmprice","id":1957930,"avatar_url":"https://avatars2.githubusercontent.com/u/1957930?v=4","gravatar_id":"","url":"https://api.github.com/users/lmprice","html_url":"https://github.com/lmprice","followers_url":"https://api.github.com/users/lmprice/followers","following_url":"https://api.github.com/users/lmprice/following{/other_user}","gists_url":"https://api.github.com/users/lmprice/gists{/gist_id}","starred_url":"https://api.github.com/users/lmprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmprice/subscriptions","organizations_url":"https://api.github.com/users/lmprice/orgs","repos_url":"https://api.github.com/users/lmprice/repos","events_url":"https://api.github.com/users/lmprice/events{/privacy}","received_events_url":"https://api.github.com/users/lmprice/received_events","type":"User","site_admin":false},"repo":{"id":80159828,"name":"ansible","full_name":"lmprice/ansible","owner":{"login":"lmprice","id":1957930,"avatar_url":"https://avatars2.githubusercontent.com/u/1957930?v=4","gravatar_id":"","url":"https://api.github.com/users/lmprice","html_url":"https://github.com/lmprice","followers_url":"https://api.github.com/users/lmprice/followers","following_url":"https://api.github.com/users/lmprice/following{/other_user}","gists_url":"https://api.github.com/users/lmprice/gists{/gist_id}","starred_url":"https://api.github.com/users/lmprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmprice/subscriptions","organizations_url":"https://api.github.com/users/lmprice/orgs","repos_url":"https://api.github.com/users/lmprice/repos","events_url":"https://api.github.com/users/lmprice/events{/privacy}","received_events_url":"https://api.github.com/users/lmprice/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmprice/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/lmprice/ansible","forks_url":"https://api.github.com/repos/lmprice/ansible/forks","keys_url":"https://api.github.com/repos/lmprice/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmprice/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmprice/ansible/teams","hooks_url":"https://api.github.com/repos/lmprice/ansible/hooks","issue_events_url":"https://api.github.com/repos/lmprice/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/lmprice/ansible/events","assignees_url":"https://api.github.com/repos/lmprice/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/lmprice/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/lmprice/ansible/tags","blobs_url":"https://api.github.com/repos/lmprice/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmprice/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmprice/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmprice/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmprice/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/lmprice/ansible/languages","stargazers_url":"https://api.github.com/repos/lmprice/ansible/stargazers","contributors_url":"https://api.github.com/repos/lmprice/ansible/contributors","subscribers_url":"https://api.github.com/repos/lmprice/ansible/subscribers","subscription_url":"https://api.github.com/repos/lmprice/ansible/subscription","commits_url":"https://api.github.com/repos/lmprice/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmprice/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmprice/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmprice/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmprice/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/lmprice/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmprice/ansible/merges","archive_url":"https://api.github.com/repos/lmprice/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmprice/ansible/downloads","issues_url":"https://api.github.com/repos/lmprice/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/lmprice/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/lmprice/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/lmprice/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmprice/ansible/labels{/name}","releases_url":"https://api.github.com/repos/lmprice/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/lmprice/ansible/deployments","created_at":"2017-01-26T22:00:14Z","updated_at":"2017-01-26T22:00:31Z","pushed_at":"2017-09-12T15:56:18Z","git_url":"git://github.com/lmprice/ansible.git","ssh_url":"git@github.com:lmprice/ansible.git","clone_url":"https://github.com/lmprice/ansible.git","svn_url":"https://github.com/lmprice/ansible","homepage":"http://ansible.com/","size":86100,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"c9cfc9be07361fc4db379fa3a386a73f83198c65","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":"2017-09-12T15:42:13Z","pushed_at":"2017-09-12T16:36:49Z","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":89897,"stargazers_count":25392,"watchers_count":25392,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8815,"mirror_url":null,"open_issues_count":4172,"forks":8815,"open_issues":4172,"watchers":25392,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/28294"},"html":{"href":"https://github.com/ansible/ansible/pull/28294"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/28294"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/28294/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/28294/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/28294/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/a3097a860095d0c36740e30fc2680e42428a6834"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hulquest"}}