Sitelet https://github.com/tejaycar/chef-ssh/commit/5ef8855e04b5ccd60eeb5518842bfe9771ed9fd4
Skip to content

Commit 5ef8855

Browse files
committed
update changelog, fix tests, and finish adding support for non-standard ports
1 parent f1287d9 commit 5ef8855

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* updates for rubocop errors
66
* Better handling for custom ssh ports - thanks @stissot
77
* handle more than one option in authorized-hosts correctly - thanks @chazzly and @rongshen-daqri
8-
8+
* Handle hashed vs non-hashed existing keys correctly - thanks @balous
99

1010
## 0.10.16
1111
* #58 fix deprication warning in default value of provider (thanks to @CloCkWeRX)

‎providers/known_hosts.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ def load_current_resource
8080
cmd =
8181
if new_resource.key.nil?
8282
"ssh-keygen #{new_resource.hashed ? '-H ' : ''} -F #{Shellwords.escape(matching_host)} "\
83-
"-f #{new_resource.path} | grep 'Host #{matching_host} found'"
83+
"-f #{new_resource.path} | grep -F 'Host #{matching_host} found'"
8484
else
85-
"cat '#{new_resource.path}' | grep '#{new_resource.key}'"
85+
"grep -F '#{new_resource.key}' '#{new_resource.path}'"
8686
end
8787

8888
search = Mixlib::ShellOut.new(cmd)

‎test/cookbooks/ssh_test/recipes/known_hosts.rb‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
(1..3).step do |n|
2828
ssh_known_hosts "altssh.bitbucket.org converge #{n}" do
2929
host 'altssh.bitbucket.org'
30+
hashed true
3031
port 443
3132
user 'root'
3233
key ::TestData.bitbucket_altssh_key

0 commit comments

Comments
 (0)