mirror of
https://github.com/inspec/inspec
synced 2024-11-22 12:43:07 +00:00
Fix usage of log level in inspec plugin installation logic
Signed-off-by: Nik08 <nikita.mathur@progress.com>
This commit is contained in:
parent
7924290714
commit
455f1a0d6f
2 changed files with 5 additions and 3 deletions
|
@ -425,8 +425,10 @@ module InspecPlugins
|
|||
"our apologies for the misunderstanding, and open an issue " \
|
||||
"at https://github.com/inspec/inspec/issues/new")
|
||||
ui.exit Inspec::UI::EXIT_PLUGIN_ERROR
|
||||
rescue Inspec::Plugin::V2::InstallError
|
||||
raise if Inspec::Log.level == :debug
|
||||
rescue Inspec::Plugin::V2::InstallError => e
|
||||
# This change is required for Ruby 3.3 upgrade
|
||||
# Using Inspec::Log::level breaks with error `undefined method nil` in Ruby log library
|
||||
Inspec::Log.debug e.backtrace
|
||||
|
||||
results = installer.search(plugin_name, exact: true)
|
||||
source_host = URI(options[:source] || "https://rubygems.org/").host
|
||||
|
|
|
@ -343,7 +343,7 @@ class PluginManagerCliInstall < Minitest::Test
|
|||
|
||||
assert_includes install_result.stdout, "DEBUG"
|
||||
|
||||
assert_includes install_result.stderr, "can't activate rake"
|
||||
assert_includes install_result.stdout, "Unknown error occurred - installation failed"
|
||||
|
||||
assert_exit_code 1, install_result
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue