mirror of
https://github.com/inspec/inspec
synced 2024-11-22 20:53:11 +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 " \
|
"our apologies for the misunderstanding, and open an issue " \
|
||||||
"at https://github.com/inspec/inspec/issues/new")
|
"at https://github.com/inspec/inspec/issues/new")
|
||||||
ui.exit Inspec::UI::EXIT_PLUGIN_ERROR
|
ui.exit Inspec::UI::EXIT_PLUGIN_ERROR
|
||||||
rescue Inspec::Plugin::V2::InstallError
|
rescue Inspec::Plugin::V2::InstallError => e
|
||||||
raise if Inspec::Log.level == :debug
|
# 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)
|
results = installer.search(plugin_name, exact: true)
|
||||||
source_host = URI(options[:source] || "https://rubygems.org/").host
|
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.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
|
assert_exit_code 1, install_result
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue