{"action":"created","comment":{"url":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/comments/37217876","id":37217876,"diff_hunk":"@@ -11,6 +11,37 @@ def creator\n         compute_options[:openstack_username]\n       end\n \n+      def create_winrm_transport(machine_spec, machine_options, server)\n+        remote_host = if machine_spec.reference['use_private_ip_for_ssh']\n+                        server.private_ip_address\n+                      elsif !server.public_ip_address\n+                        Chef::Log.warn(\"Server #{machine_spec.name} has no public ip address.  Using private ip '#{server.private_ip_address}'.  Set driver option 'use_private_ip_for_ssh' => true if this will always be the case ...\")\n+                        server.private_ip_address\n+                      elsif server.public_ip_address\n+                        server.public_ip_address\n+                      else\n+                        fail \"Server #{server.id} has no private or public IP address!\"\n+                      end\n+\t\tChef::Log::info(\"Connecting to server #{remote_host}\")\n+\t\t\n+        port = machine_spec.reference['winrm_port'] || 5985","path":"lib/chef/provisioning/fog_driver/providers/openstack.rb","position":17,"original_position":17,"commit_id":"37d0ca1de3778b5362141e828505ff053f56833f","original_commit_id":"37d0ca1de3778b5362141e828505ff053f56833f","user":{"login":"tyler-ball","id":2481463,"avatar_url":"https://avatars.githubusercontent.com/u/2481463?v=3","gravatar_id":"","url":"https://api.github.com/users/tyler-ball","html_url":"https://github.com/tyler-ball","followers_url":"https://api.github.com/users/tyler-ball/followers","following_url":"https://api.github.com/users/tyler-ball/following{/other_user}","gists_url":"https://api.github.com/users/tyler-ball/gists{/gist_id}","starred_url":"https://api.github.com/users/tyler-ball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyler-ball/subscriptions","organizations_url":"https://api.github.com/users/tyler-ball/orgs","repos_url":"https://api.github.com/users/tyler-ball/repos","events_url":"https://api.github.com/users/tyler-ball/events{/privacy}","received_events_url":"https://api.github.com/users/tyler-ball/received_events","type":"User","site_admin":false},"body":"A couple of notes about this:\r\n\r\n1.  I like that you're pulling the information out of the reference.  It is the right thing to do for many reasons\r\n1.  Because the `reference` is just a hash, you should be doing `machine_spec.reference['winrm']['port']` (and `['winrm']['password'] and `['winrm']['username']` below).  This will make it easier to read and is more ruby-style\r\n1.  Where does the reference get populated with these?  I would expect to see something around [here](https://github.com/chef/chef-provisioning-fog/blob/master/lib/chef/provisioning/fog_driver/driver.rb#L340-L342).  If you use a nested hash (like I recommend in item 2) then all you would need to do is add `winrm` to that hash.\r\n1. You should add documentation to [here](https://github.com/chef/chef-provisioning-fog/blob/master/lib/chef/provisioning/fog_driver/driver.rb#L76) describing the new `winrm` key that can be passed and what subkeys it accepts (port, username, password).","created_at":"2015-08-17T18:11:10Z","updated_at":"2015-08-17T18:11:10Z","html_url":"https://github.com/chef/chef-provisioning-fog/pull/109#discussion_r37217876","pull_request_url":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/109","_links":{"self":{"href":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/comments/37217876"},"html":{"href":"https://github.com/chef/chef-provisioning-fog/pull/109#discussion_r37217876"},"pull_request":{"href":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/109","id":38284203,"html_url":"https://github.com/chef/chef-provisioning-fog/pull/109","diff_url":"https://github.com/chef/chef-provisioning-fog/pull/109.diff","patch_url":"https://github.com/chef/chef-provisioning-fog/pull/109.patch","issue_url":"https://api.github.com/repos/chef/chef-provisioning-fog/issues/109","number":109,"state":"open","locked":false,"title":"Implementation of create_winrm_transport for OpenStack provider","user":{"login":"brumschlag","id":128108,"avatar_url":"https://avatars.githubusercontent.com/u/128108?v=3","gravatar_id":"","url":"https://api.github.com/users/brumschlag","html_url":"https://github.com/brumschlag","followers_url":"https://api.github.com/users/brumschlag/followers","following_url":"https://api.github.com/users/brumschlag/following{/other_user}","gists_url":"https://api.github.com/users/brumschlag/gists{/gist_id}","starred_url":"https://api.github.com/users/brumschlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brumschlag/subscriptions","organizations_url":"https://api.github.com/users/brumschlag/orgs","repos_url":"https://api.github.com/users/brumschlag/repos","events_url":"https://api.github.com/users/brumschlag/events{/privacy}","received_events_url":"https://api.github.com/users/brumschlag/received_events","type":"User","site_admin":false},"body":"Right now, you cannot create a windows image on OpenStack. The OpenStack provider lacks an implementation of create_winrm_transport.\r\n\r\nI added a machine_option[:adminPassword] which contains the admin password for the image.\r\nOther than that, it works just like the create_winrm_transport implementation for the aws provider","created_at":"2015-06-22T22:35:46Z","updated_at":"2015-08-17T18:11:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"caeb3604e7bf0766a1604fafec0cd1ffc14d5e8b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/109/commits","review_comments_url":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/109/comments","review_comment_url":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/chef-provisioning-fog/issues/109/comments","statuses_url":"https://api.github.com/repos/chef/chef-provisioning-fog/statuses/37d0ca1de3778b5362141e828505ff053f56833f","head":{"label":"brumschlag:master","ref":"master","sha":"37d0ca1de3778b5362141e828505ff053f56833f","user":{"login":"brumschlag","id":128108,"avatar_url":"https://avatars.githubusercontent.com/u/128108?v=3","gravatar_id":"","url":"https://api.github.com/users/brumschlag","html_url":"https://github.com/brumschlag","followers_url":"https://api.github.com/users/brumschlag/followers","following_url":"https://api.github.com/users/brumschlag/following{/other_user}","gists_url":"https://api.github.com/users/brumschlag/gists{/gist_id}","starred_url":"https://api.github.com/users/brumschlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brumschlag/subscriptions","organizations_url":"https://api.github.com/users/brumschlag/orgs","repos_url":"https://api.github.com/users/brumschlag/repos","events_url":"https://api.github.com/users/brumschlag/events{/privacy}","received_events_url":"https://api.github.com/users/brumschlag/received_events","type":"User","site_admin":false},"repo":{"id":37883792,"name":"chef-provisioning-fog","full_name":"brumschlag/chef-provisioning-fog","owner":{"login":"brumschlag","id":128108,"avatar_url":"https://avatars.githubusercontent.com/u/128108?v=3","gravatar_id":"","url":"https://api.github.com/users/brumschlag","html_url":"https://github.com/brumschlag","followers_url":"https://api.github.com/users/brumschlag/followers","following_url":"https://api.github.com/users/brumschlag/following{/other_user}","gists_url":"https://api.github.com/users/brumschlag/gists{/gist_id}","starred_url":"https://api.github.com/users/brumschlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brumschlag/subscriptions","organizations_url":"https://api.github.com/users/brumschlag/orgs","repos_url":"https://api.github.com/users/brumschlag/repos","events_url":"https://api.github.com/users/brumschlag/events{/privacy}","received_events_url":"https://api.github.com/users/brumschlag/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brumschlag/chef-provisioning-fog","description":"Fog driver for Chef Provisioning","fork":true,"url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog","forks_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/forks","keys_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/teams","hooks_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/hooks","issue_events_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/issues/events{/number}","events_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/events","assignees_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/assignees{/user}","branches_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/branches{/branch}","tags_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/tags","blobs_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/git/refs{/sha}","trees_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/statuses/{sha}","languages_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/languages","stargazers_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/stargazers","contributors_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/contributors","subscribers_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/subscribers","subscription_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/subscription","commits_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/commits{/sha}","git_commits_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/git/commits{/sha}","comments_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/comments{/number}","issue_comment_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/issues/comments{/number}","contents_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/contents/{+path}","compare_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/merges","archive_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/downloads","issues_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/issues{/number}","pulls_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/pulls{/number}","milestones_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/milestones{/number}","notifications_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/labels{/name}","releases_url":"https://api.github.com/repos/brumschlag/chef-provisioning-fog/releases{/id}","created_at":"2015-06-22T22:23:34Z","updated_at":"2015-06-22T22:23:34Z","pushed_at":"2015-08-13T14:12:57Z","git_url":"git://github.com/brumschlag/chef-provisioning-fog.git","ssh_url":"git@github.com:brumschlag/chef-provisioning-fog.git","clone_url":"https://github.com/brumschlag/chef-provisioning-fog.git","svn_url":"https://github.com/brumschlag/chef-provisioning-fog","homepage":"","size":388,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"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":"master"}},"base":{"label":"chef:master","ref":"master","sha":"ebd78fae4b4582c5abd284b1cbe9954e425f2eda","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":18450862,"name":"chef-provisioning-fog","full_name":"chef/chef-provisioning-fog","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef-provisioning-fog","description":"Fog driver for Chef Provisioning","fork":false,"url":"https://api.github.com/repos/chef/chef-provisioning-fog","forks_url":"https://api.github.com/repos/chef/chef-provisioning-fog/forks","keys_url":"https://api.github.com/repos/chef/chef-provisioning-fog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef-provisioning-fog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef-provisioning-fog/teams","hooks_url":"https://api.github.com/repos/chef/chef-provisioning-fog/hooks","issue_events_url":"https://api.github.com/repos/chef/chef-provisioning-fog/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef-provisioning-fog/events","assignees_url":"https://api.github.com/repos/chef/chef-provisioning-fog/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef-provisioning-fog/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef-provisioning-fog/tags","blobs_url":"https://api.github.com/repos/chef/chef-provisioning-fog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef-provisioning-fog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef-provisioning-fog/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef-provisioning-fog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef-provisioning-fog/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef-provisioning-fog/languages","stargazers_url":"https://api.github.com/repos/chef/chef-provisioning-fog/stargazers","contributors_url":"https://api.github.com/repos/chef/chef-provisioning-fog/contributors","subscribers_url":"https://api.github.com/repos/chef/chef-provisioning-fog/subscribers","subscription_url":"https://api.github.com/repos/chef/chef-provisioning-fog/subscription","commits_url":"https://api.github.com/repos/chef/chef-provisioning-fog/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef-provisioning-fog/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef-provisioning-fog/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef-provisioning-fog/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef-provisioning-fog/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef-provisioning-fog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef-provisioning-fog/merges","archive_url":"https://api.github.com/repos/chef/chef-provisioning-fog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef-provisioning-fog/downloads","issues_url":"https://api.github.com/repos/chef/chef-provisioning-fog/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef-provisioning-fog/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef-provisioning-fog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef-provisioning-fog/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef-provisioning-fog/releases{/id}","created_at":"2014-04-04T19:51:32Z","updated_at":"2015-06-24T20:49:50Z","pushed_at":"2015-08-13T14:12:57Z","git_url":"git://github.com/chef/chef-provisioning-fog.git","ssh_url":"git@github.com:chef/chef-provisioning-fog.git","clone_url":"https://github.com/chef/chef-provisioning-fog.git","svn_url":"https://github.com/chef/chef-provisioning-fog","homepage":"","size":1691,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":28,"forks":59,"open_issues":28,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/109"},"html":{"href":"https://github.com/chef/chef-provisioning-fog/pull/109"},"issue":{"href":"https://api.github.com/repos/chef/chef-provisioning-fog/issues/109"},"comments":{"href":"https://api.github.com/repos/chef/chef-provisioning-fog/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/chef-provisioning-fog/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/chef/chef-provisioning-fog/statuses/37d0ca1de3778b5362141e828505ff053f56833f"}}}}