diff options
author | Thom May <thom@may.lt> | 2018-01-21 15:46:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-21 15:46:02 +0000 |
commit | 2fef9c4839205903acb8983a8487625a07e351b1 (patch) | |
tree | c0f8b11c98c6f1e0d774429e1c2774fb1a7348d4 /lib/chef/knife | |
parent | d767381b3f2eed6893fa0405c0af9b5466c18099 (diff) | |
parent | 746562d6358c27b838c95ea27b2a2bd82c03cefe (diff) | |
download | chef-2fef9c4839205903acb8983a8487625a07e351b1.tar.gz |
Merge pull request #6749 from chef/lcg/rubocop-0.52.1
prepping for rubocop 0.52.1
Diffstat (limited to 'lib/chef/knife')
-rw-r--r-- | lib/chef/knife/cookbook_metadata.rb | 4 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_site_install.rb | 4 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_test.rb | 4 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_upload.rb | 4 | ||||
-rw-r--r-- | lib/chef/knife/environment_compare.rb | 6 | ||||
-rw-r--r-- | lib/chef/knife/ssh.rb | 4 | ||||
-rw-r--r-- | lib/chef/knife/xargs.rb | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/lib/chef/knife/cookbook_metadata.rb b/lib/chef/knife/cookbook_metadata.rb index 29eba6a36a..e089c4b777 100644 --- a/lib/chef/knife/cookbook_metadata.rb +++ b/lib/chef/knife/cookbook_metadata.rb @@ -1,7 +1,7 @@ # # # Author:: Adam Jacob (<adam@chef.io>) -# Copyright:: Copyright 2009-2016, Chef Software Inc. +# Copyright:: Copyright 2009-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -47,7 +47,7 @@ class Chef if config[:all] cl = Chef::CookbookLoader.new(config[:cookbook_path]) cl.load_cookbooks - cl.each do |cname, cookbook| + cl.each_key do |cname| generate_metadata(cname.to_s) end else diff --git a/lib/chef/knife/cookbook_site_install.rb b/lib/chef/knife/cookbook_site_install.rb index 72fb426554..f4d692e13c 100644 --- a/lib/chef/knife/cookbook_site_install.rb +++ b/lib/chef/knife/cookbook_site_install.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob (<adam@chef.io>) -# Copyright:: Copyright 2010-2016, Chef Software Inc. +# Copyright:: Copyright 2010-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -116,7 +116,7 @@ class Chef end unless config[:no_deps] - preferred_metadata.dependencies.each do |cookbook, version_list| + preferred_metadata.dependencies.each_key do |cookbook| # Doesn't do versions.. yet nv = self.class.new nv.config = config diff --git a/lib/chef/knife/cookbook_test.rb b/lib/chef/knife/cookbook_test.rb index 5c6dd32f37..f3a4981c95 100644 --- a/lib/chef/knife/cookbook_test.rb +++ b/lib/chef/knife/cookbook_test.rb @@ -2,7 +2,7 @@ # # Author:: Adam Jacob (<adam@chef.io>) # Author:: Matthew Kent (<mkent@magoazul.com>) -# Copyright:: Copyright 2009-2016, Chef Software Inc. +# Copyright:: Copyright 2009-2018, Chef Software Inc. # Copyright:: Copyright 2010-2016, Matthew Kent # License:: Apache License, Version 2.0 # @@ -50,7 +50,7 @@ class Chef if config[:all] cl = cookbook_loader cl.load_cookbooks - cl.each do |key, cookbook| + cl.each_key do |key| checked_a_cookbook = true test_cookbook(key) end diff --git a/lib/chef/knife/cookbook_upload.rb b/lib/chef/knife/cookbook_upload.rb index 92084e7906..f67a26dc9a 100644 --- a/lib/chef/knife/cookbook_upload.rb +++ b/lib/chef/knife/cookbook_upload.rb @@ -2,7 +2,7 @@ # Author:: Adam Jacob (<adam@chef.io>) # Author:: Christopher Walters (<cw@chef.io>) # Author:: Nuo Yan (<yan.nuo@gmail.com>) -# Copyright:: Copyright 2009-2016, Chef Software Inc. +# Copyright:: Copyright 2009-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -172,7 +172,7 @@ class Chef if ! upload_set.has_key?(cookbook_name) upload_set[cookbook_name] = cookbook_repo[cookbook_name] if config[:depends] - upload_set[cookbook_name].metadata.dependencies.each { |dep, ver| @name_args << dep } + upload_set[cookbook_name].metadata.dependencies.each_key { |dep| @name_args << dep } end end rescue Exceptions::CookbookNotFoundInRepo => e diff --git a/lib/chef/knife/environment_compare.rb b/lib/chef/knife/environment_compare.rb index 8a2ef853d3..2e70783d3f 100644 --- a/lib/chef/knife/environment_compare.rb +++ b/lib/chef/knife/environment_compare.rb @@ -94,17 +94,17 @@ class Chef def cookbook_list(constraints) result = {} - constraints.each { |env, cb| result.merge!(cb) } + constraints.each_value { |cb| result.merge!(cb) } result end def matrix_output(cookbooks, constraints) rows = [ "" ] environments = [] - constraints.each { |e, v| environments << e.to_s } + constraints.each_key { |e| environments << e.to_s } columns = environments.count + 1 environments.each { |env| rows << ui.color(env, :bold) } - cookbooks.each do |c, v| + cookbooks.each_key do |c| total = [] environments.each { |n| total << constraints[n][c] } if total.uniq.count == 1 diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb index b6abd67719..b3d84e42d1 100644 --- a/lib/chef/knife/ssh.rb +++ b/lib/chef/knife/ssh.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob (<adam@chef.io>) -# Copyright:: Copyright 2009-2017, Chef Software Inc. +# Copyright:: Copyright 2009-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -315,7 +315,7 @@ class Chef end def fixup_sudo(command) - command.sub(/^sudo/, 'sudo -p \'knife sudo password: \'') + command.sub(/^sudo/, "sudo -p 'knife sudo password: '") end def print_data(host, data) diff --git a/lib/chef/knife/xargs.rb b/lib/chef/knife/xargs.rb index 7f436d7936..a316fb8cf7 100644 --- a/lib/chef/knife/xargs.rb +++ b/lib/chef/knife/xargs.rb @@ -181,7 +181,7 @@ class Chef def destroy_tempfiles(tempfiles) # Unlink the files now that we're done with them - tempfiles.keys.each { |tempfile| tempfile.close! } + tempfiles.each_key { |tempfile| tempfile.close! } end def xargs_files(command, tempfiles) |