{"action":"created","comment":{"url":"https://api.github.com/repos/chef/knife-windows/pulls/comments/43057137","id":43057137,"diff_hunk":"@@ -93,8 +101,91 @@ def resolve_target_nodes\n             end\n           end\n \n+          # TODO: Copied from Knife::Core:GenericPresenter. Should be extracted\n+          def extract_nested_value(data, nested_value_spec)\n+            nested_value_spec.split(\".\").each do |attr|\n+              if data.nil?\n+                nil # don't get no method error on nil\n+              elsif data.respond_to?(attr.to_sym)\n+                data = data.send(attr.to_sym)\n+              elsif data.respond_to?(:[])\n+                data = data[attr]\n+              else\n+                data = begin\n+                         data.send(attr.to_sym)\n+                       rescue NoMethodError\n+                         nil\n+                       end\n+              end\n+            end\n+            ( !data.kind_of?(Array) && data.respond_to?(:to_hash) ) ? data.to_hash : data\n+          end\n+\n+          def run_command(command = '')\n+            relay_winrm_command(command)\n+\n+            check_for_errors!\n+\n+            # Knife seems to ignore the return value of this method,\n+            # so we exit to force the process exit code for this\n+            # subcommand if returns is set\n+            exit @exit_code if @exit_code && @exit_code != 0\n+            @exit_code || 0","path":"lib/chef/knife/winrm_knife_base.rb","position":48,"original_position":48,"commit_id":"1fb9cc3681ad45f7b90f5b6ec617226a4cd9c5aa","original_commit_id":"1fb9cc3681ad45f7b90f5b6ec617226a4cd9c5aa","user":{"login":"jaym","id":27443,"avatar_url":"https://avatars.githubusercontent.com/u/27443?v=3","gravatar_id":"","url":"https://api.github.com/users/jaym","html_url":"https://github.com/jaym","followers_url":"https://api.github.com/users/jaym/followers","following_url":"https://api.github.com/users/jaym/following{/other_user}","gists_url":"https://api.github.com/users/jaym/gists{/gist_id}","starred_url":"https://api.github.com/users/jaym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaym/subscriptions","organizations_url":"https://api.github.com/users/jaym/orgs","repos_url":"https://api.github.com/users/jaym/repos","events_url":"https://api.github.com/users/jaym/events{/privacy}","received_events_url":"https://api.github.com/users/jaym/received_events","type":"User","site_admin":false},"body":"should this just be 0?","created_at":"2015-10-26T21:39:19Z","updated_at":"2015-10-26T21:39:19Z","html_url":"https://github.com/chef/knife-windows/pull/312#discussion_r43057137","pull_request_url":"https://api.github.com/repos/chef/knife-windows/pulls/312","_links":{"self":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/comments/43057137"},"html":{"href":"https://github.com/chef/knife-windows/pull/312#discussion_r43057137"},"pull_request":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/312"}}},"pull_request":{"url":"https://api.github.com/repos/chef/knife-windows/pulls/312","id":48644433,"html_url":"https://github.com/chef/knife-windows/pull/312","diff_url":"https://github.com/chef/knife-windows/pull/312.diff","patch_url":"https://github.com/chef/knife-windows/pull/312.patch","issue_url":"https://api.github.com/repos/chef/knife-windows/issues/312","number":312,"state":"open","locked":false,"title":"knife winrm bootstrap should not swallow failed exit codes","user":{"login":"mwrock","id":655165,"avatar_url":"https://avatars.githubusercontent.com/u/655165?v=3","gravatar_id":"","url":"https://api.github.com/users/mwrock","html_url":"https://github.com/mwrock","followers_url":"https://api.github.com/users/mwrock/followers","following_url":"https://api.github.com/users/mwrock/following{/other_user}","gists_url":"https://api.github.com/users/mwrock/gists{/gist_id}","starred_url":"https://api.github.com/users/mwrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwrock/subscriptions","organizations_url":"https://api.github.com/users/mwrock/orgs","repos_url":"https://api.github.com/users/mwrock/repos","events_url":"https://api.github.com/users/mwrock/events{/privacy}","received_events_url":"https://api.github.com/users/mwrock/received_events","type":"User","site_admin":false},"body":"This fixes #311 and consolidates error handling logic to ensure both knife winrm and knife winrm bootstrap follow the same path.","created_at":"2015-10-24T00:44:22Z","updated_at":"2015-10-26T21:39:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6756e59078d2b519a459a7e85a3a61da9009bf4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chef/knife-windows/pulls/312/commits","review_comments_url":"https://api.github.com/repos/chef/knife-windows/pulls/312/comments","review_comment_url":"https://api.github.com/repos/chef/knife-windows/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/knife-windows/issues/312/comments","statuses_url":"https://api.github.com/repos/chef/knife-windows/statuses/1fb9cc3681ad45f7b90f5b6ec617226a4cd9c5aa","head":{"label":"chef:mwrock/common_refactor","ref":"mwrock/common_refactor","sha":"1fb9cc3681ad45f7b90f5b6ec617226a4cd9c5aa","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":1440272,"name":"knife-windows","full_name":"chef/knife-windows","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/knife-windows","description":"Plugin for Chef's knife tool for working with Windows nodes","fork":false,"url":"https://api.github.com/repos/chef/knife-windows","forks_url":"https://api.github.com/repos/chef/knife-windows/forks","keys_url":"https://api.github.com/repos/chef/knife-windows/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/knife-windows/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/knife-windows/teams","hooks_url":"https://api.github.com/repos/chef/knife-windows/hooks","issue_events_url":"https://api.github.com/repos/chef/knife-windows/issues/events{/number}","events_url":"https://api.github.com/repos/chef/knife-windows/events","assignees_url":"https://api.github.com/repos/chef/knife-windows/assignees{/user}","branches_url":"https://api.github.com/repos/chef/knife-windows/branches{/branch}","tags_url":"https://api.github.com/repos/chef/knife-windows/tags","blobs_url":"https://api.github.com/repos/chef/knife-windows/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/knife-windows/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/knife-windows/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/knife-windows/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/knife-windows/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/knife-windows/languages","stargazers_url":"https://api.github.com/repos/chef/knife-windows/stargazers","contributors_url":"https://api.github.com/repos/chef/knife-windows/contributors","subscribers_url":"https://api.github.com/repos/chef/knife-windows/subscribers","subscription_url":"https://api.github.com/repos/chef/knife-windows/subscription","commits_url":"https://api.github.com/repos/chef/knife-windows/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/knife-windows/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/knife-windows/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/knife-windows/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/knife-windows/contents/{+path}","compare_url":"https://api.github.com/repos/chef/knife-windows/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/knife-windows/merges","archive_url":"https://api.github.com/repos/chef/knife-windows/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/knife-windows/downloads","issues_url":"https://api.github.com/repos/chef/knife-windows/issues{/number}","pulls_url":"https://api.github.com/repos/chef/knife-windows/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/knife-windows/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/knife-windows/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/knife-windows/labels{/name}","releases_url":"https://api.github.com/repos/chef/knife-windows/releases{/id}","created_at":"2011-03-04T17:30:51Z","updated_at":"2015-10-21T16:22:58Z","pushed_at":"2015-10-26T18:39:51Z","git_url":"git://github.com/chef/knife-windows.git","ssh_url":"git@github.com:chef/knife-windows.git","clone_url":"https://github.com/chef/knife-windows.git","svn_url":"https://github.com/chef/knife-windows","homepage":"","size":2882,"stargazers_count":112,"watchers_count":112,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":28,"forks":99,"open_issues":28,"watchers":112,"default_branch":"master"}},"base":{"label":"chef:master","ref":"master","sha":"94bb8cd7143ed5c512919177af56185404463841","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":1440272,"name":"knife-windows","full_name":"chef/knife-windows","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/knife-windows","description":"Plugin for Chef's knife tool for working with Windows nodes","fork":false,"url":"https://api.github.com/repos/chef/knife-windows","forks_url":"https://api.github.com/repos/chef/knife-windows/forks","keys_url":"https://api.github.com/repos/chef/knife-windows/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/knife-windows/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/knife-windows/teams","hooks_url":"https://api.github.com/repos/chef/knife-windows/hooks","issue_events_url":"https://api.github.com/repos/chef/knife-windows/issues/events{/number}","events_url":"https://api.github.com/repos/chef/knife-windows/events","assignees_url":"https://api.github.com/repos/chef/knife-windows/assignees{/user}","branches_url":"https://api.github.com/repos/chef/knife-windows/branches{/branch}","tags_url":"https://api.github.com/repos/chef/knife-windows/tags","blobs_url":"https://api.github.com/repos/chef/knife-windows/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/knife-windows/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/knife-windows/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/knife-windows/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/knife-windows/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/knife-windows/languages","stargazers_url":"https://api.github.com/repos/chef/knife-windows/stargazers","contributors_url":"https://api.github.com/repos/chef/knife-windows/contributors","subscribers_url":"https://api.github.com/repos/chef/knife-windows/subscribers","subscription_url":"https://api.github.com/repos/chef/knife-windows/subscription","commits_url":"https://api.github.com/repos/chef/knife-windows/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/knife-windows/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/knife-windows/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/knife-windows/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/knife-windows/contents/{+path}","compare_url":"https://api.github.com/repos/chef/knife-windows/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/knife-windows/merges","archive_url":"https://api.github.com/repos/chef/knife-windows/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/knife-windows/downloads","issues_url":"https://api.github.com/repos/chef/knife-windows/issues{/number}","pulls_url":"https://api.github.com/repos/chef/knife-windows/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/knife-windows/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/knife-windows/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/knife-windows/labels{/name}","releases_url":"https://api.github.com/repos/chef/knife-windows/releases{/id}","created_at":"2011-03-04T17:30:51Z","updated_at":"2015-10-21T16:22:58Z","pushed_at":"2015-10-26T18:39:51Z","git_url":"git://github.com/chef/knife-windows.git","ssh_url":"git@github.com:chef/knife-windows.git","clone_url":"https://github.com/chef/knife-windows.git","svn_url":"https://github.com/chef/knife-windows","homepage":"","size":2882,"stargazers_count":112,"watchers_count":112,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":28,"forks":99,"open_issues":28,"watchers":112,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/312"},"html":{"href":"https://github.com/chef/knife-windows/pull/312"},"issue":{"href":"https://api.github.com/repos/chef/knife-windows/issues/312"},"comments":{"href":"https://api.github.com/repos/chef/knife-windows/issues/312/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/312/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/knife-windows/pulls/312/commits"},"statuses":{"href":"https://api.github.com/repos/chef/knife-windows/statuses/1fb9cc3681ad45f7b90f5b6ec617226a4cd9c5aa"}}}}