{"action":"created","comment":{"url":"https://api.github.com/repos/chef/chef/pulls/comments/29675669","id":29675669,"diff_hunk":"@@ -160,6 +160,31 @@ def configure_session\n         session_from_list(list)\n       end\n \n+      def get_ssh_attribute(node)\n+        # Order of precedence for ssh target\n+        # 1) command line attribute\n+        # 2) configuration file\n+        # 3) cloud attribute\n+        # 4) fqdn\n+        if config[:attribute_from_cli]","path":"lib/chef/knife/ssh.rb","position":null,"original_position":10,"commit_id":"c645f7d8ff0a8cd29a451c375a06e1ebb6bb758f","original_commit_id":"11c177f934f1bfdac4525e02c042dc599b6c044b","user":{"login":"Igorshp","id":3381045,"avatar_url":"https://avatars.githubusercontent.com/u/3381045?v=3","gravatar_id":"","url":"https://api.github.com/users/Igorshp","html_url":"https://github.com/Igorshp","followers_url":"https://api.github.com/users/Igorshp/followers","following_url":"https://api.github.com/users/Igorshp/following{/other_user}","gists_url":"https://api.github.com/users/Igorshp/gists{/gist_id}","starred_url":"https://api.github.com/users/Igorshp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igorshp/subscriptions","organizations_url":"https://api.github.com/users/Igorshp/orgs","repos_url":"https://api.github.com/users/Igorshp/repos","events_url":"https://api.github.com/users/Igorshp/events{/privacy}","received_events_url":"https://api.github.com/users/Igorshp/received_events","type":"User","site_admin":false},"body":"Looks like that was the only change needed.\r\nI have done some extra testing of the latest code with various combinations of cli and config. \r\nThe priority behaviour works as expected.\r\n1 commandline\r\n2 config file\r\n3 cloud\r\n\r\nThanks!","created_at":"2015-05-05T14:51:41Z","updated_at":"2015-05-05T14:51:41Z","html_url":"https://github.com/chef/chef/pull/2851#discussion_r29675669","pull_request_url":"https://api.github.com/repos/chef/chef/pulls/2851","_links":{"self":{"href":"https://api.github.com/repos/chef/chef/pulls/comments/29675669"},"html":{"href":"https://github.com/chef/chef/pull/2851#discussion_r29675669"},"pull_request":{"href":"https://api.github.com/repos/chef/chef/pulls/2851"}}},"pull_request":{"url":"https://api.github.com/repos/chef/chef/pulls/2851","id":28564444,"html_url":"https://github.com/chef/chef/pull/2851","diff_url":"https://github.com/chef/chef/pull/2851.diff","patch_url":"https://github.com/chef/chef/pull/2851.patch","issue_url":"https://api.github.com/repos/chef/chef/issues/2851","number":2851,"state":"open","locked":false,"title":"Prioritise manual ssh attribute over defaults","user":{"login":"Igorshp","id":3381045,"avatar_url":"https://avatars.githubusercontent.com/u/3381045?v=3","gravatar_id":"","url":"https://api.github.com/users/Igorshp","html_url":"https://github.com/Igorshp","followers_url":"https://api.github.com/users/Igorshp/followers","following_url":"https://api.github.com/users/Igorshp/following{/other_user}","gists_url":"https://api.github.com/users/Igorshp/gists{/gist_id}","starred_url":"https://api.github.com/users/Igorshp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igorshp/subscriptions","organizations_url":"https://api.github.com/users/Igorshp/orgs","repos_url":"https://api.github.com/users/Igorshp/repos","events_url":"https://api.github.com/users/Igorshp/events{/privacy}","received_events_url":"https://api.github.com/users/Igorshp/received_events","type":"User","site_admin":false},"body":"PR to fix  https://github.com/chef/chef/issues/2325\r\nand also https://tickets.opscode.com/browse/CHEF-4962?focusedCommentId=46454&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-46454\r\n\r\nMy argument for this is as follows:\r\n\r\nall manual overrides should take priority over whatever the default/automatic lookups that exist.\r\n\r\nthe priority list for the host attribute is as follows:\r\n\r\n1. command line\r\n2. knife.rb :ssh_attribute value\r\n3. cloud.public_hostname value\r\n4. fqdn parameter\r\n\r\nthe last 2 are essentially defaults. ","created_at":"2015-02-03T16:07:41Z","updated_at":"2015-05-05T14:51:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"360780868a68f212a50b0bd5262b93c018265d3e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chef/chef/pulls/2851/commits","review_comments_url":"https://api.github.com/repos/chef/chef/pulls/2851/comments","review_comment_url":"https://api.github.com/repos/chef/chef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/chef/issues/2851/comments","statuses_url":"https://api.github.com/repos/chef/chef/statuses/c645f7d8ff0a8cd29a451c375a06e1ebb6bb758f","head":{"label":"Igorshp:ssh_attribute","ref":"ssh_attribute","sha":"c645f7d8ff0a8cd29a451c375a06e1ebb6bb758f","user":{"login":"Igorshp","id":3381045,"avatar_url":"https://avatars.githubusercontent.com/u/3381045?v=3","gravatar_id":"","url":"https://api.github.com/users/Igorshp","html_url":"https://github.com/Igorshp","followers_url":"https://api.github.com/users/Igorshp/followers","following_url":"https://api.github.com/users/Igorshp/following{/other_user}","gists_url":"https://api.github.com/users/Igorshp/gists{/gist_id}","starred_url":"https://api.github.com/users/Igorshp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igorshp/subscriptions","organizations_url":"https://api.github.com/users/Igorshp/orgs","repos_url":"https://api.github.com/users/Igorshp/repos","events_url":"https://api.github.com/users/Igorshp/events{/privacy}","received_events_url":"https://api.github.com/users/Igorshp/received_events","type":"User","site_admin":false},"repo":{"id":30249802,"name":"chef","full_name":"Igorshp/chef","owner":{"login":"Igorshp","id":3381045,"avatar_url":"https://avatars.githubusercontent.com/u/3381045?v=3","gravatar_id":"","url":"https://api.github.com/users/Igorshp","html_url":"https://github.com/Igorshp","followers_url":"https://api.github.com/users/Igorshp/followers","following_url":"https://api.github.com/users/Igorshp/following{/other_user}","gists_url":"https://api.github.com/users/Igorshp/gists{/gist_id}","starred_url":"https://api.github.com/users/Igorshp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igorshp/subscriptions","organizations_url":"https://api.github.com/users/Igorshp/orgs","repos_url":"https://api.github.com/users/Igorshp/repos","events_url":"https://api.github.com/users/Igorshp/events{/privacy}","received_events_url":"https://api.github.com/users/Igorshp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Igorshp/chef","description":"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.","fork":true,"url":"https://api.github.com/repos/Igorshp/chef","forks_url":"https://api.github.com/repos/Igorshp/chef/forks","keys_url":"https://api.github.com/repos/Igorshp/chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Igorshp/chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Igorshp/chef/teams","hooks_url":"https://api.github.com/repos/Igorshp/chef/hooks","issue_events_url":"https://api.github.com/repos/Igorshp/chef/issues/events{/number}","events_url":"https://api.github.com/repos/Igorshp/chef/events","assignees_url":"https://api.github.com/repos/Igorshp/chef/assignees{/user}","branches_url":"https://api.github.com/repos/Igorshp/chef/branches{/branch}","tags_url":"https://api.github.com/repos/Igorshp/chef/tags","blobs_url":"https://api.github.com/repos/Igorshp/chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Igorshp/chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Igorshp/chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/Igorshp/chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Igorshp/chef/statuses/{sha}","languages_url":"https://api.github.com/repos/Igorshp/chef/languages","stargazers_url":"https://api.github.com/repos/Igorshp/chef/stargazers","contributors_url":"https://api.github.com/repos/Igorshp/chef/contributors","subscribers_url":"https://api.github.com/repos/Igorshp/chef/subscribers","subscription_url":"https://api.github.com/repos/Igorshp/chef/subscription","commits_url":"https://api.github.com/repos/Igorshp/chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/Igorshp/chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/Igorshp/chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/Igorshp/chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/Igorshp/chef/contents/{+path}","compare_url":"https://api.github.com/repos/Igorshp/chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Igorshp/chef/merges","archive_url":"https://api.github.com/repos/Igorshp/chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Igorshp/chef/downloads","issues_url":"https://api.github.com/repos/Igorshp/chef/issues{/number}","pulls_url":"https://api.github.com/repos/Igorshp/chef/pulls{/number}","milestones_url":"https://api.github.com/repos/Igorshp/chef/milestones{/number}","notifications_url":"https://api.github.com/repos/Igorshp/chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Igorshp/chef/labels{/name}","releases_url":"https://api.github.com/repos/Igorshp/chef/releases{/id}","created_at":"2015-02-03T15:33:42Z","updated_at":"2015-02-03T15:33:48Z","pushed_at":"2015-05-05T14:42:21Z","git_url":"git://github.com/Igorshp/chef.git","ssh_url":"git@github.com:Igorshp/chef.git","clone_url":"https://github.com/Igorshp/chef.git","svn_url":"https://github.com/Igorshp/chef","homepage":"http://www.chef.io/chef/","size":78947,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"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":"master"}},"base":{"label":"chef:master","ref":"master","sha":"44d70ba0f1b38bc3e1170ae978ad5e9a11679df3","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":108278,"name":"chef","full_name":"chef/chef","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","description":"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.","fork":false,"url":"https://api.github.com/repos/chef/chef","forks_url":"https://api.github.com/repos/chef/chef/forks","keys_url":"https://api.github.com/repos/chef/chef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef/teams","hooks_url":"https://api.github.com/repos/chef/chef/hooks","issue_events_url":"https://api.github.com/repos/chef/chef/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef/events","assignees_url":"https://api.github.com/repos/chef/chef/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef/tags","blobs_url":"https://api.github.com/repos/chef/chef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef/languages","stargazers_url":"https://api.github.com/repos/chef/chef/stargazers","contributors_url":"https://api.github.com/repos/chef/chef/contributors","subscribers_url":"https://api.github.com/repos/chef/chef/subscribers","subscription_url":"https://api.github.com/repos/chef/chef/subscription","commits_url":"https://api.github.com/repos/chef/chef/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef/merges","archive_url":"https://api.github.com/repos/chef/chef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef/downloads","issues_url":"https://api.github.com/repos/chef/chef/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef/releases{/id}","created_at":"2009-01-15T20:40:48Z","updated_at":"2015-05-05T12:22:24Z","pushed_at":"2015-05-05T14:44:03Z","git_url":"git://github.com/chef/chef.git","ssh_url":"git@github.com:chef/chef.git","clone_url":"https://github.com/chef/chef.git","svn_url":"https://github.com/chef/chef","homepage":"http://www.chef.io/chef/","size":167619,"stargazers_count":3572,"watchers_count":3572,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1446,"mirror_url":null,"open_issues_count":435,"forks":1446,"open_issues":435,"watchers":3572,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/chef/pulls/2851"},"html":{"href":"https://github.com/chef/chef/pull/2851"},"issue":{"href":"https://api.github.com/repos/chef/chef/issues/2851"},"comments":{"href":"https://api.github.com/repos/chef/chef/issues/2851/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/chef/pulls/2851/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/chef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/chef/pulls/2851/commits"},"statuses":{"href":"https://api.github.com/repos/chef/chef/statuses/c645f7d8ff0a8cd29a451c375a06e1ebb6bb758f"}}}}