summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@chef.io>2019-11-04 14:57:31 -0800
committerGitHub <noreply@github.com>2019-11-04 14:57:31 -0800
commitdcd095ddc7f1eba319da8664e4cb73cb98c71810 (patch)
tree32a58e2a98959497f26488c2f387c5800cdf54c1
parent72352921c1b03957fdf39794737f45c88a9346ba (diff)
parent950f7f127d585eff203db8bd0b4904ca9282b6fd (diff)
downloadchef-dcd095ddc7f1eba319da8664e4cb73cb98c71810.tar.gz
Updates for Chefstyle with Rubocop 0.75.1 (#9055)
Updates for Chefstyle with Rubocop 0.75.1
-rw-r--r--lib/chef/data_collector.rb4
-rw-r--r--lib/chef/knife/configure.rb2
-rw-r--r--lib/chef/knife/core/status_presenter.rb2
-rw-r--r--lib/chef/node/attribute.rb4
-rw-r--r--lib/chef/provider/file.rb2
-rw-r--r--spec/unit/knife/status_spec.rb2
-rw-r--r--spec/unit/provider/package/openbsd_spec.rb2
-rw-r--r--spec/unit/provider/package/smartos_spec.rb2
8 files changed, 10 insertions, 10 deletions
diff --git a/lib/chef/data_collector.rb b/lib/chef/data_collector.rb
index 931671bf50..787747444d 100644
--- a/lib/chef/data_collector.rb
+++ b/lib/chef/data_collector.rb
@@ -64,8 +64,8 @@ class Chef
# @param events [Chef::EventDispatch::Dispatcher] the event dispatcher
def initialize(events)
@events = events
- @expanded_run_list = {}
- @deprecations = Set.new
+ @expanded_run_list = {}
+ @deprecations = Set.new
end
# Hook to grab the run_status. We also make the decision to run or not run here (our
diff --git a/lib/chef/knife/configure.rb b/lib/chef/knife/configure.rb
index 739428d5e3..888b4290dd 100644
--- a/lib/chef/knife/configure.rb
+++ b/lib/chef/knife/configure.rb
@@ -120,7 +120,7 @@ class Chef
@admin_client_key = config[:admin_client_key] || ask_question("Please enter the location of the existing admin's private key: ", default: "#{Chef::Dist::SERVER_CONF_DIR}/admin.pem")
@admin_client_key = File.expand_path(@admin_client_key)
else
- @new_client_name = config[:node_name] || ask_question("Please enter an existing username or clientname for the API: ", default: Etc.getlogin)
+ @new_client_name = config[:node_name] || ask_question("Please enter an existing username or clientname for the API: ", default: Etc.getlogin)
end
@new_client_key = config[:client_key] || File.join(chef_config_path, "#{@new_client_name}.pem")
diff --git a/lib/chef/knife/core/status_presenter.rb b/lib/chef/knife/core/status_presenter.rb
index 562bd7b0e9..9042350295 100644
--- a/lib/chef/knife/core/status_presenter.rb
+++ b/lib/chef/knife/core/status_presenter.rb
@@ -112,7 +112,7 @@ class Chef
if node["ohai_time"]
hours, minutes, seconds = time_difference_in_hms(node["ohai_time"])
- hours_text = "#{hours} hour#{hours == 1 ? " " : "s"}"
+ hours_text = "#{hours} hour#{hours == 1 ? " " : "s"}"
minutes_text = "#{minutes} minute#{minutes == 1 ? " " : "s"}"
seconds_text = "#{seconds} second#{seconds == 1 ? " " : "s"}"
if hours > 24
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb
index 8bccc9a05d..d872e53d9b 100644
--- a/lib/chef/node/attribute.rb
+++ b/lib/chef/node/attribute.rb
@@ -199,14 +199,14 @@ class Chef
@role_default = VividMash.new({}, self, node, :role_default)
@force_default = VividMash.new({}, self, node, :force_default)
- @normal = VividMash.new(normal, self, node, :normal)
+ @normal = VividMash.new(normal, self, node, :normal)
@override = VividMash.new(override, self, node, :override)
@role_override = VividMash.new({}, self, node, :role_override)
@env_override = VividMash.new({}, self, node, :env_override)
@force_override = VividMash.new({}, self, node, :force_override)
- @automatic = VividMash.new(automatic, self, node, :automatic)
+ @automatic = VividMash.new(automatic, self, node, :automatic)
super(nil, self, node, :merged)
end
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb
index 054b9718c3..7f4de1eaef 100644
--- a/lib/chef/provider/file.rb
+++ b/lib/chef/provider/file.rb
@@ -84,7 +84,7 @@ class Chef
end
# true if we are going to be creating a new file
- @needs_creating = !::File.exist?(new_resource.path) || needs_unlinking?
+ @needs_creating = !::File.exist?(new_resource.path) || needs_unlinking?
# Let children resources override constructing the current_resource
@current_resource ||= Chef::Resource::File.new(new_resource.name)
diff --git a/spec/unit/knife/status_spec.rb b/spec/unit/knife/status_spec.rb
index dc66007c32..8af3b3e871 100644
--- a/spec/unit/knife/status_spec.rb
+++ b/spec/unit/knife/status_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Knife::Status do
@query = double("Chef::Search::Query")
allow(@query).to receive(:search).and_yield(node)
allow(Chef::Search::Query).to receive(:new).and_return(@query)
- @knife = Chef::Knife::Status.new
+ @knife = Chef::Knife::Status.new
@stdout = StringIO.new
allow(@knife.ui).to receive(:stdout).and_return(@stdout)
end
diff --git a/spec/unit/provider/package/openbsd_spec.rb b/spec/unit/provider/package/openbsd_spec.rb
index c8de4b7471..dee49534c3 100644
--- a/spec/unit/provider/package/openbsd_spec.rb
+++ b/spec/unit/provider/package/openbsd_spec.rb
@@ -120,7 +120,7 @@ describe Chef::Provider::Package::Openbsd do
describe "delete a package" do
before do
@name = "ihavetoes"
- @new_resource = Chef::Resource::Package.new(@name)
+ @new_resource = Chef::Resource::Package.new(@name)
@current_resource = Chef::Resource::Package.new(@name)
@provider = Chef::Provider::Package::Openbsd.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
diff --git a/spec/unit/provider/package/smartos_spec.rb b/spec/unit/provider/package/smartos_spec.rb
index 726420fe23..91ccb87211 100644
--- a/spec/unit/provider/package/smartos_spec.rb
+++ b/spec/unit/provider/package/smartos_spec.rb
@@ -25,7 +25,7 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
@node = Chef::Node.new
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
- @new_resource = Chef::Resource::Package.new("varnish")
+ @new_resource = Chef::Resource::Package.new("varnish")
@current_resource = Chef::Resource::Package.new("varnish")
@status = double("Status", exitstatus: 0)