diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-09 12:24:46 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-16 18:41:25 -0700 |
commit | c030f338ab37a5ce16de5b31006a278ac3767ca4 (patch) | |
tree | 72f9fcd1bd8aeb4d7372da0d58118baecf2d7468 | |
parent | 5d07da13f9909ea500ed8d76e83512f91ea3e461 (diff) | |
download | chef-c030f338ab37a5ce16de5b31006a278ac3767ca4.tar.gz |
autofixing Style/RedundantException cop
-rw-r--r-- | lib/chef/cookbook/cookbook_version_loader.rb | 2 | ||||
-rw-r--r-- | lib/chef/file_cache.rb | 2 | ||||
-rw-r--r-- | lib/chef/util/dsc/configuration_generator.rb | 2 | ||||
-rw-r--r-- | lib/chef/util/selinux.rb | 2 | ||||
-rw-r--r-- | spec/functional/resource/deploy_revision_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/platform_helpers.rb | 2 | ||||
-rw-r--r-- | spec/unit/data_collector_spec.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/package/rubygems_spec.rb | 4 |
8 files changed, 9 insertions, 9 deletions
diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb index d9b027f322..cf72426740 100644 --- a/lib/chef/cookbook/cookbook_version_loader.rb +++ b/lib/chef/cookbook/cookbook_version_loader.rb @@ -168,7 +168,7 @@ class Chef when /\.json$/ apply_json_metadata(metadata_file) else - raise RuntimeError, "Invalid metadata file: #{metadata_file} for cookbook: #{cookbook_version}" + raise "Invalid metadata file: #{metadata_file} for cookbook: #{cookbook_version}" end end diff --git a/lib/chef/file_cache.rb b/lib/chef/file_cache.rb index cefc9da1eb..8e9bb1e3e4 100644 --- a/lib/chef/file_cache.rb +++ b/lib/chef/file_cache.rb @@ -85,7 +85,7 @@ class Chef File.join(create_cache_path(File.join(file_path_array), true), file_name) ) else - raise RuntimeError, "Cannot move #{file} to #{path}!" + raise "Cannot move #{file} to #{path}!" end end diff --git a/lib/chef/util/dsc/configuration_generator.rb b/lib/chef/util/dsc/configuration_generator.rb index 739a463ad5..8b492d483a 100644 --- a/lib/chef/util/dsc/configuration_generator.rb +++ b/lib/chef/util/dsc/configuration_generator.rb @@ -48,7 +48,7 @@ class Chef::Util::DSC configuration_document_location = find_configuration_document(configuration_name) if ! configuration_document_location - raise RuntimeError, "No DSC configuration for '#{configuration_name}' was generated from supplied DSC script" + raise "No DSC configuration for '#{configuration_name}' was generated from supplied DSC script" end configuration_document = get_configuration_document(configuration_document_location) diff --git a/lib/chef/util/selinux.rb b/lib/chef/util/selinux.rb index 1aac7eeeca..edca589034 100644 --- a/lib/chef/util/selinux.rb +++ b/lib/chef/util/selinux.rb @@ -78,7 +78,7 @@ class Chef when 0 return true else - raise RuntimeError, "Unknown exit code from command #{selinuxenabled_path}: #{cmd.exitstatus}" + raise "Unknown exit code from command #{selinuxenabled_path}: #{cmd.exitstatus}" end else # We assume selinux is not enabled if selinux utils are not diff --git a/spec/functional/resource/deploy_revision_spec.rb b/spec/functional/resource/deploy_revision_spec.rb index 72eaea3c12..572609d8ff 100644 --- a/spec/functional/resource/deploy_revision_spec.rb +++ b/spec/functional/resource/deploy_revision_spec.rb @@ -840,7 +840,7 @@ describe Chef::Resource::DeployRevision, :unix_only => true, :requires_git => tr end def run_action(action) - raise RuntimeError, "network error" + raise "network error" end end diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index 9ba56a15e3..4b727a18ca 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -169,7 +169,7 @@ def selinux_enabled? when 0 return true else - raise RuntimeError, "Unknown exit code from command #{selinuxenabled_path}: #{cmd.exitstatus}" + raise "Unknown exit code from command #{selinuxenabled_path}: #{cmd.exitstatus}" end else # We assume selinux is not enabled if selinux utils are not diff --git a/spec/unit/data_collector_spec.rb b/spec/unit/data_collector_spec.rb index 131d6b8df9..764510d0ad 100644 --- a/spec/unit/data_collector_spec.rb +++ b/spec/unit/data_collector_spec.rb @@ -488,7 +488,7 @@ describe Chef::DataCollector::Reporter do context "when an unexpected exception is raised by the block" do it "re-raises the exception" do - expect { reporter.send(:disable_reporter_on_error) { raise RuntimeError, "bummer" } }.to raise_error(RuntimeError) + expect { reporter.send(:disable_reporter_on_error) { raise "bummer" } }.to raise_error(RuntimeError) end end diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb index ed109bf20f..b1ebde2b7d 100644 --- a/spec/unit/provider/package/rubygems_spec.rb +++ b/spec/unit/provider/package/rubygems_spec.rb @@ -63,7 +63,7 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do begin @gem_env.with_gem_sources("http://gems.example.org") do sources_in_block = Gem.sources - raise RuntimeError, "sources should be reset even in case of an error" + raise "sources should be reset even in case of an error" end rescue RuntimeError end @@ -77,7 +77,7 @@ describe Chef::Provider::Package::Rubygems::CurrentGemEnvironment do begin @gem_env.with_gem_sources(nil) do sources_in_block = Gem.sources - raise RuntimeError, "sources should be reset even in case of an error" + raise "sources should be reset even in case of an error" end rescue RuntimeError end |