Skip to content

Commit

Permalink
Merge pull request #123 from operatingops/fix_deprecation_warnings
Browse files Browse the repository at this point in the history
Fix deprecation warnings
  • Loading branch information
chris-rock authored Sep 25, 2016
2 parents afff57b + 3d7ff56 commit 6b22038
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion recipes/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
message "ssh/client/#{setting} set from deprecated ssh/#{setting}"
level :warn
end
node.set['ssh']['client'][setting] = node['ssh'][setting]
node.default['ssh']['client'][setting] = node['ssh'][setting]
else
log "ignored-ssh/#{setting}_client" do
message "Ignoring ssh/#{setting}:true for client"
Expand Down
2 changes: 1 addition & 1 deletion recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
message "ssh/server/#{setting} set from deprecated ssh/#{setting}"
level :warn
end
node.set['ssh']['server'][setting] = node['ssh'][setting]
node.default['ssh']['server'][setting] = node['ssh'][setting]
else
log "ignored-ssh/#{setting}_server" do
message "Ignoring ssh/#{setting}:true for server"
Expand Down
30 changes: 15 additions & 15 deletions spec/recipes/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
context 'weak_hmac enabled only for the client' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['client']['weak_hmac'] = true
node.normal['ssh']['client']['weak_hmac'] = true
end.converge(described_recipe)
end

Expand All @@ -93,7 +93,7 @@
context 'weak_hmac enabled only for the server' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['server']['weak_hmac'] = true
node.normal['ssh']['server']['weak_hmac'] = true
end.converge(described_recipe)
end

Expand All @@ -106,7 +106,7 @@
context 'weak_kex enabled for the client only' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['client']['weak_kex'] = true
node.normal['ssh']['client']['weak_kex'] = true
end.converge(described_recipe)
end

Expand All @@ -127,7 +127,7 @@
context 'weak_kexs enabled for the server only' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['server']['weak_kex'] = true
node.normal['ssh']['server']['weak_kex'] = true
end.converge(described_recipe)
end

Expand All @@ -144,7 +144,7 @@
context 'cbc_required set for the client only' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['client']['cbc_required'] = true
node.normal['ssh']['client']['cbc_required'] = true
end.converge(described_recipe)
end

Expand All @@ -163,7 +163,7 @@
context 'cbc_required set for the server only' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['server']['cbc_required'] = true
node.normal['ssh']['server']['cbc_required'] = true
end.converge(described_recipe)
end

Expand All @@ -177,7 +177,7 @@
context 'legacy attribute ssl/weak_hmac set' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['weak_hmac'] = true
node.normal['ssh']['weak_hmac'] = true
end.converge(described_recipe)
end

Expand Down Expand Up @@ -210,7 +210,7 @@
context 'legacy attribute weak_kex set' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['weak_kex'] = true
node.normal['ssh']['weak_kex'] = true
end.converge(described_recipe)
end

Expand Down Expand Up @@ -243,7 +243,7 @@
context 'legacy attribute cbc_required set' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['cbc_required'] = true
node.normal['ssh']['cbc_required'] = true
end.converge(described_recipe)
end

Expand Down Expand Up @@ -289,9 +289,9 @@
# don't use cache, log persists
let(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh'][attr] = true
node.set['ssh']['client'][attr] = false
node.set['ssh']['server'][attr] = true
node.normal['ssh'][attr] = true
node.normal['ssh']['client'][attr] = false
node.normal['ssh']['server'][attr] = true
end.converge(described_recipe)
end

Expand All @@ -306,9 +306,9 @@
# don't use cache, log persists
let(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh'][attr] = true
node.set['ssh']['client'][attr] = true
node.set['ssh']['server'][attr] = false
node.normal['ssh'][attr] = true
node.normal['ssh']['client'][attr] = true
node.normal['ssh']['server'][attr] = false
end.converge(described_recipe)
end

Expand Down
50 changes: 25 additions & 25 deletions spec/recipes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
context 'with weak hmacs enabled for the server' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['server']['weak_hmac'] = true
node.normal['ssh']['server']['weak_hmac'] = true
end.converge(described_recipe)
end

Expand All @@ -96,7 +96,7 @@
context 'with weak hmacs enabled for only the client' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node, server|
node.set['ssh']['server']['client']['weak_hmac'] = true
node.normal['ssh']['server']['client']['weak_hmac'] = true
server.create_data_bag('users', 'someuser' => { id: 'someuser' })
end.converge(described_recipe)
end
Expand All @@ -110,7 +110,7 @@
context 'weak_kex enabled for only the server' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['server']['weak_kex'] = true
node.normal['ssh']['server']['weak_kex'] = true
end.converge(described_recipe)
end

Expand All @@ -131,7 +131,7 @@
context 'weak_kex enabled for only the client' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node, server|
node.set['ssh']['client']['weak_kex'] = true
node.normal['ssh']['client']['weak_kex'] = true
server.create_data_bag('users', 'someuser' => { id: 'someuser' })
end.converge(described_recipe)
end
Expand All @@ -149,7 +149,7 @@
context 'cbc_required for the server only' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['server']['cbc_required'] = true
node.normal['ssh']['server']['cbc_required'] = true
end.converge(described_recipe)
end

Expand All @@ -168,7 +168,7 @@
context 'cbc_required for the client only' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node, server|
node.set['ssh']['client']['cbc_required'] = true
node.normal['ssh']['client']['cbc_required'] = true
server.create_data_bag('users', 'someuser' => { id: 'someuser' })
end.converge(described_recipe)
end
Expand All @@ -184,7 +184,7 @@
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node, server|
server.create_data_bag('users', 'someuser' => { id: 'someuser' })
node.set['ssh']['weak_hmac'] = true
node.normal['ssh']['weak_hmac'] = true
end.converge(described_recipe)
end

Expand Down Expand Up @@ -217,7 +217,7 @@
context 'legacy attribute weak_kex set' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node, server|
node.set['ssh']['weak_kex'] = true
node.normal['ssh']['weak_kex'] = true
server.create_data_bag('users', 'someuser' => { id: 'someuser' })
end.converge(described_recipe)
end
Expand Down Expand Up @@ -251,7 +251,7 @@
context 'legacy attribute cbc_required set' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node, server|
node.set['ssh']['cbc_required'] = true
node.normal['ssh']['cbc_required'] = true
server.create_data_bag('users', 'someuser' => { id: 'someuser' })
end.converge(described_recipe)
end
Expand Down Expand Up @@ -297,9 +297,9 @@
# don't use cache, log persists
let(:chef_run) do
ChefSpec::ServerRunner.new do |node, server|
node.set['ssh'][attr] = true
node.set['ssh']['client'][attr] = true
node.set['ssh']['server'][attr] = false
node.normal['ssh'][attr] = true
node.normal['ssh']['client'][attr] = true
node.normal['ssh']['server'][attr] = false
server.create_data_bag('users', 'someuser' => { id: 'someuser' })
end.converge(described_recipe)
end
Expand All @@ -315,9 +315,9 @@
# don't use cache, log persists
let(:chef_run) do
ChefSpec::ServerRunner.new do |node, server|
node.set['ssh'][attr] = true
node.set['ssh']['client'][attr] = false
node.set['ssh']['server'][attr] = true
node.normal['ssh'][attr] = true
node.normal['ssh']['client'][attr] = false
node.normal['ssh']['server'][attr] = true
server.create_data_bag('users', 'someuser' => { id: 'someuser' })
end.converge(described_recipe)
end
Expand Down Expand Up @@ -352,7 +352,7 @@
context 'with attribute allow_root_with_key' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['allow_root_with_key'] = true
node.normal['ssh']['allow_root_with_key'] = true
end.converge(described_recipe)
end

Expand Down Expand Up @@ -449,7 +449,7 @@
context 'with attribute deny_users' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['deny_users'] = %w(someuser)
node.normal['ssh']['deny_users'] = %w(someuser)
end.converge(described_recipe)
end

Expand All @@ -462,7 +462,7 @@
context 'with attribute deny_users mutiple' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['deny_users'] = %w(someuser otheruser)
node.normal['ssh']['deny_users'] = %w(someuser otheruser)
end.converge(described_recipe)
end

Expand All @@ -482,7 +482,7 @@
context 'with attribute use_dns set to false' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['use_dns'] = false
node.normal['ssh']['use_dns'] = false
end.converge(described_recipe)
end

Expand All @@ -495,7 +495,7 @@
context 'with attribute use_dns set to true' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['use_dns'] = true
node.normal['ssh']['use_dns'] = true
end.converge(described_recipe)
end

Expand All @@ -515,7 +515,7 @@
context 'with attribute ["sftp"]["enable"] set to true' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['sftp']['enable'] = true
node.normal['ssh']['sftp']['enable'] = true
end.converge(described_recipe)
end

Expand All @@ -528,8 +528,8 @@
context 'with attribute ["sftp"]["enable"] set to true and ["sftp"]["group"] set to "testgroup"' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['sftp']['enable'] = true
node.set['ssh']['sftp']['group'] = 'testgroup'
node.normal['ssh']['sftp']['enable'] = true
node.normal['ssh']['sftp']['group'] = 'testgroup'
end.converge(described_recipe)
end

Expand All @@ -542,8 +542,8 @@
context 'with attribute ["sftp"]["enable"] set to true and ["sftp"]["chroot"] set to "/export/home/%u"' do
cached(:chef_run) do
ChefSpec::ServerRunner.new do |node|
node.set['ssh']['sftp']['enable'] = true
node.set['ssh']['sftp']['chroot'] = 'test_home_dir'
node.normal['ssh']['sftp']['enable'] = true
node.normal['ssh']['sftp']['chroot'] = 'test_home_dir'
end.converge(described_recipe)
end

Expand Down

0 comments on commit 6b22038

Please sign in to comment.