{"action":"created","comment":{"url":"https://api.github.com/repos/saltstack/salt/pulls/comments/141380757","pull_request_review_id":65585951,"id":141380757,"diff_hunk":"@@ -1,5 +1,7 @@\n # -*- coding: utf-8 -*-\n '''\n+import sys\n+import ssl","path":"salt/utils/vmware.py","position":4,"original_position":4,"commit_id":"c51891c939f176b5e4237b9cc9b9a14ab9806fbc","original_commit_id":"c51891c939f176b5e4237b9cc9b9a14ab9806fbc","user":{"login":"alexbleotu","id":17009281,"avatar_url":"https://avatars3.githubusercontent.com/u/17009281?v=4","gravatar_id":"","url":"https://api.github.com/users/alexbleotu","html_url":"https://github.com/alexbleotu","followers_url":"https://api.github.com/users/alexbleotu/followers","following_url":"https://api.github.com/users/alexbleotu/following{/other_user}","gists_url":"https://api.github.com/users/alexbleotu/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbleotu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbleotu/subscriptions","organizations_url":"https://api.github.com/users/alexbleotu/orgs","repos_url":"https://api.github.com/users/alexbleotu/repos","events_url":"https://api.github.com/users/alexbleotu/events{/privacy}","received_events_url":"https://api.github.com/users/alexbleotu/received_events","type":"User","site_admin":false},"body":"my bad will take them out","created_at":"2017-09-27T15:29:54Z","updated_at":"2017-09-27T15:29:54Z","html_url":"https://github.com/saltstack/salt/pull/43674#discussion_r141380757","pull_request_url":"https://api.github.com/repos/saltstack/salt/pulls/43674","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt/pulls/comments/141380757"},"html":{"href":"https://github.com/saltstack/salt/pull/43674#discussion_r141380757"},"pull_request":{"href":"https://api.github.com/repos/saltstack/salt/pulls/43674"}},"in_reply_to_id":141370468},"pull_request":{"url":"https://api.github.com/repos/saltstack/salt/pulls/43674","id":142365643,"html_url":"https://github.com/saltstack/salt/pull/43674","diff_url":"https://github.com/saltstack/salt/pull/43674.diff","patch_url":"https://github.com/saltstack/salt/pull/43674.patch","issue_url":"https://api.github.com/repos/saltstack/salt/issues/43674","number":43674,"state":"open","locked":false,"title":"VMware vCenter proxy + storage policies states & dependencies","user":{"login":"alexbleotu","id":17009281,"avatar_url":"https://avatars3.githubusercontent.com/u/17009281?v=4","gravatar_id":"","url":"https://api.github.com/users/alexbleotu","html_url":"https://github.com/alexbleotu","followers_url":"https://api.github.com/users/alexbleotu/followers","following_url":"https://api.github.com/users/alexbleotu/following{/other_user}","gists_url":"https://api.github.com/users/alexbleotu/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbleotu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbleotu/subscriptions","organizations_url":"https://api.github.com/users/alexbleotu/orgs","repos_url":"https://api.github.com/users/alexbleotu/repos","events_url":"https://api.github.com/users/alexbleotu/events{/privacy}","received_events_url":"https://api.github.com/users/alexbleotu/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\n\r\nAdded a vCenter specific proxy and the functions required to configure storage policies (previously known as storage profiles) on the vCenter. This requires to connect to a different endpoint called `/pbm` which names the state and utils modules. The execution function is `vsphere`\r\n\r\nExamples of the input expected to configure a storage policy can be found in the sysdoc of `salt.states.pbm`.\r\n\r\nList of functions:\r\nProxy:\r\n- all required functions to run the `vcenter` proxy\r\n- some existing functions and tests in the `vsphere` module have been adjusted to support the new proxy\r\n\r\nUtils functions\r\n- get_new_service_instance_stub that creates a new service instance stub\r\n- salt.utils.pbm.get_profile_manager\r\n- salt.utils.pbm.get_placement_solver\r\n- salt.utils.pbm.get_capability_definitions\r\n- salt.utils.pbm.get_policies_by_id\r\n- salt.utils.pbm.get_storage_policies\r\n- salt.utils.pbm.create_storage_policy\r\n- salt.utils.pbm.create_storage_policy\r\n- salt.utils.pbm.update_storage_policy\r\n- salt.utils.pbm.get_default_storage_policy_of_datastore\r\n- salt.utils.pbm.assign_default_storage_policy_to_datastore\r\n\r\nExecution functions:\r\n\r\n- salt.modules.vsphere._get_policy_dict that transforms a policy VMware object into a dict representation\r\n- salt.modules.vsphere.list_storage_policies that retrieves dict representations of storage policies, filtered by name\r\n- salt.modules.vsphere.list_default_vsan_policy that retrieves dict representation of the default storage policies\r\n- salt.modules.vsphere._get_capability_definition_dict that transforms a VMware capability definition into a dict representation\r\n- salt.modules.vsphere.list_capability_definitions that returns dict representations of VMware capability definition\r\n- salt.modules.vsphere._apply_policy_config that applies a storage dict representations values to a object\r\n- salt.modules.vsphere.create_storage_policy\r\n- salt.modules.vsphere.update_storage_policy\r\n- salt.modules.vsphere.list_default_storage_policy_of_datastore that lists the dict representation of the policy assigned by default to a datastore\r\n- salt.modules.vsphere.assign_default_storage_policy_to_datastore\r\n\r\nStates functions:\r\n\r\n- salt.states.pbm.default_vsan_policy_configured state that configures the default storage policy\r\n- salt.states.pbm.storage_policies_configured state that creates/configures storage policies\r\n- salt.states.pbm.default_storage_policy_assigned state that manages default storage policies to datastore assigments\r\n\r\n### Tests written?\r\n\r\nYes (for utils functions)\r\n\r\nPlease review [Salt's Contributing Guide](https://docs.saltstack.com/en/latest/topics/development/contributing.html) for best practices.\r\n","created_at":"2017-09-21T14:53:23Z","updated_at":"2017-09-27T15:29:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7951c12887678da020a4ea28b5338e02f54277a8","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/saltstack/salt/pulls/43674/commits","review_comments_url":"https://api.github.com/repos/saltstack/salt/pulls/43674/comments","review_comment_url":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/43674/comments","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/c51891c939f176b5e4237b9cc9b9a14ab9806fbc","head":{"label":"alexbleotu:storage_policies-gh","ref":"storage_policies-gh","sha":"c51891c939f176b5e4237b9cc9b9a14ab9806fbc","user":{"login":"alexbleotu","id":17009281,"avatar_url":"https://avatars3.githubusercontent.com/u/17009281?v=4","gravatar_id":"","url":"https://api.github.com/users/alexbleotu","html_url":"https://github.com/alexbleotu","followers_url":"https://api.github.com/users/alexbleotu/followers","following_url":"https://api.github.com/users/alexbleotu/following{/other_user}","gists_url":"https://api.github.com/users/alexbleotu/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbleotu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbleotu/subscriptions","organizations_url":"https://api.github.com/users/alexbleotu/orgs","repos_url":"https://api.github.com/users/alexbleotu/repos","events_url":"https://api.github.com/users/alexbleotu/events{/privacy}","received_events_url":"https://api.github.com/users/alexbleotu/received_events","type":"User","site_admin":false},"repo":{"id":59563027,"name":"salt","full_name":"alexbleotu/salt","owner":{"login":"alexbleotu","id":17009281,"avatar_url":"https://avatars3.githubusercontent.com/u/17009281?v=4","gravatar_id":"","url":"https://api.github.com/users/alexbleotu","html_url":"https://github.com/alexbleotu","followers_url":"https://api.github.com/users/alexbleotu/followers","following_url":"https://api.github.com/users/alexbleotu/following{/other_user}","gists_url":"https://api.github.com/users/alexbleotu/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbleotu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbleotu/subscriptions","organizations_url":"https://api.github.com/users/alexbleotu/orgs","repos_url":"https://api.github.com/users/alexbleotu/repos","events_url":"https://api.github.com/users/alexbleotu/events{/privacy}","received_events_url":"https://api.github.com/users/alexbleotu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexbleotu/salt","description":"Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt Open software package repository here: ","fork":true,"url":"https://api.github.com/repos/alexbleotu/salt","forks_url":"https://api.github.com/repos/alexbleotu/salt/forks","keys_url":"https://api.github.com/repos/alexbleotu/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexbleotu/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexbleotu/salt/teams","hooks_url":"https://api.github.com/repos/alexbleotu/salt/hooks","issue_events_url":"https://api.github.com/repos/alexbleotu/salt/issues/events{/number}","events_url":"https://api.github.com/repos/alexbleotu/salt/events","assignees_url":"https://api.github.com/repos/alexbleotu/salt/assignees{/user}","branches_url":"https://api.github.com/repos/alexbleotu/salt/branches{/branch}","tags_url":"https://api.github.com/repos/alexbleotu/salt/tags","blobs_url":"https://api.github.com/repos/alexbleotu/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexbleotu/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexbleotu/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexbleotu/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexbleotu/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/alexbleotu/salt/languages","stargazers_url":"https://api.github.com/repos/alexbleotu/salt/stargazers","contributors_url":"https://api.github.com/repos/alexbleotu/salt/contributors","subscribers_url":"https://api.github.com/repos/alexbleotu/salt/subscribers","subscription_url":"https://api.github.com/repos/alexbleotu/salt/subscription","commits_url":"https://api.github.com/repos/alexbleotu/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexbleotu/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexbleotu/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexbleotu/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexbleotu/salt/contents/{+path}","compare_url":"https://api.github.com/repos/alexbleotu/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexbleotu/salt/merges","archive_url":"https://api.github.com/repos/alexbleotu/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexbleotu/salt/downloads","issues_url":"https://api.github.com/repos/alexbleotu/salt/issues{/number}","pulls_url":"https://api.github.com/repos/alexbleotu/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/alexbleotu/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/alexbleotu/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexbleotu/salt/labels{/name}","releases_url":"https://api.github.com/repos/alexbleotu/salt/releases{/id}","deployments_url":"https://api.github.com/repos/alexbleotu/salt/deployments","created_at":"2016-05-24T10:17:46Z","updated_at":"2016-05-24T10:18:01Z","pushed_at":"2017-09-27T00:22:51Z","git_url":"git://github.com/alexbleotu/salt.git","ssh_url":"git@github.com:alexbleotu/salt.git","clone_url":"https://github.com/alexbleotu/salt.git","svn_url":"https://github.com/alexbleotu/salt","homepage":"https://repo.saltstack.com/","size":176669,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"saltstack:develop","ref":"develop","sha":"6186da6d416dcf9a48188f1d9bf4e9e3c1e14512","user":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars3.githubusercontent.com/u/1147473?v=4","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"repo":{"id":1390248,"name":"salt","full_name":"saltstack/salt","owner":{"login":"saltstack","id":1147473,"avatar_url":"https://avatars3.githubusercontent.com/u/1147473?v=4","gravatar_id":"","url":"https://api.github.com/users/saltstack","html_url":"https://github.com/saltstack","followers_url":"https://api.github.com/users/saltstack/followers","following_url":"https://api.github.com/users/saltstack/following{/other_user}","gists_url":"https://api.github.com/users/saltstack/gists{/gist_id}","starred_url":"https://api.github.com/users/saltstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltstack/subscriptions","organizations_url":"https://api.github.com/users/saltstack/orgs","repos_url":"https://api.github.com/users/saltstack/repos","events_url":"https://api.github.com/users/saltstack/events{/privacy}","received_events_url":"https://api.github.com/users/saltstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/saltstack/salt","description":"Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here: ","fork":false,"url":"https://api.github.com/repos/saltstack/salt","forks_url":"https://api.github.com/repos/saltstack/salt/forks","keys_url":"https://api.github.com/repos/saltstack/salt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/saltstack/salt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/saltstack/salt/teams","hooks_url":"https://api.github.com/repos/saltstack/salt/hooks","issue_events_url":"https://api.github.com/repos/saltstack/salt/issues/events{/number}","events_url":"https://api.github.com/repos/saltstack/salt/events","assignees_url":"https://api.github.com/repos/saltstack/salt/assignees{/user}","branches_url":"https://api.github.com/repos/saltstack/salt/branches{/branch}","tags_url":"https://api.github.com/repos/saltstack/salt/tags","blobs_url":"https://api.github.com/repos/saltstack/salt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/saltstack/salt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/saltstack/salt/git/refs{/sha}","trees_url":"https://api.github.com/repos/saltstack/salt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/saltstack/salt/statuses/{sha}","languages_url":"https://api.github.com/repos/saltstack/salt/languages","stargazers_url":"https://api.github.com/repos/saltstack/salt/stargazers","contributors_url":"https://api.github.com/repos/saltstack/salt/contributors","subscribers_url":"https://api.github.com/repos/saltstack/salt/subscribers","subscription_url":"https://api.github.com/repos/saltstack/salt/subscription","commits_url":"https://api.github.com/repos/saltstack/salt/commits{/sha}","git_commits_url":"https://api.github.com/repos/saltstack/salt/git/commits{/sha}","comments_url":"https://api.github.com/repos/saltstack/salt/comments{/number}","issue_comment_url":"https://api.github.com/repos/saltstack/salt/issues/comments{/number}","contents_url":"https://api.github.com/repos/saltstack/salt/contents/{+path}","compare_url":"https://api.github.com/repos/saltstack/salt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/saltstack/salt/merges","archive_url":"https://api.github.com/repos/saltstack/salt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/saltstack/salt/downloads","issues_url":"https://api.github.com/repos/saltstack/salt/issues{/number}","pulls_url":"https://api.github.com/repos/saltstack/salt/pulls{/number}","milestones_url":"https://api.github.com/repos/saltstack/salt/milestones{/number}","notifications_url":"https://api.github.com/repos/saltstack/salt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/saltstack/salt/labels{/name}","releases_url":"https://api.github.com/repos/saltstack/salt/releases{/id}","deployments_url":"https://api.github.com/repos/saltstack/salt/deployments","created_at":"2011-02-20T20:16:56Z","updated_at":"2017-09-27T09:20:07Z","pushed_at":"2017-09-27T15:30:11Z","git_url":"git://github.com/saltstack/salt.git","ssh_url":"git@github.com:saltstack/salt.git","clone_url":"https://github.com/saltstack/salt.git","svn_url":"https://github.com/saltstack/salt","homepage":"https://repo.saltstack.com/","size":178629,"stargazers_count":8137,"watchers_count":8137,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3786,"mirror_url":null,"open_issues_count":4516,"forks":3786,"open_issues":4516,"watchers":8137,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/saltstack/salt/pulls/43674"},"html":{"href":"https://github.com/saltstack/salt/pull/43674"},"issue":{"href":"https://api.github.com/repos/saltstack/salt/issues/43674"},"comments":{"href":"https://api.github.com/repos/saltstack/salt/issues/43674/comments"},"review_comments":{"href":"https://api.github.com/repos/saltstack/salt/pulls/43674/comments"},"review_comment":{"href":"https://api.github.com/repos/saltstack/salt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/saltstack/salt/pulls/43674/commits"},"statuses":{"href":"https://api.github.com/repos/saltstack/salt/statuses/c51891c939f176b5e4237b9cc9b9a14ab9806fbc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexbleotu"}}