mirror of
https://github.com/inspec/inspec
synced 2024-11-13 00:17:08 +00:00
In habitat, train-* are system gems (#4897)
In habitat, train-* are system gems
This commit is contained in:
commit
5b81c5ad39
3 changed files with 11 additions and 6 deletions
|
@ -470,5 +470,5 @@ rescue Inspec::Plugin::V2::Exception => v2ex
|
||||||
else
|
else
|
||||||
Inspec::Log.error "Run again with --debug for a stacktrace."
|
Inspec::Log.error "Run again with --debug for a stacktrace."
|
||||||
end
|
end
|
||||||
ui.exit Inspec::UI::EXIT_PLUGIN_ERROR
|
exit Inspec::UI::EXIT_PLUGIN_ERROR
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,6 +32,13 @@ module Inspec::Plugin::V2
|
||||||
|
|
||||||
# Identify plugins that inspec is co-installed with
|
# Identify plugins that inspec is co-installed with
|
||||||
detect_system_plugins unless options[:omit_sys_plugins]
|
detect_system_plugins unless options[:omit_sys_plugins]
|
||||||
|
|
||||||
|
# Train plugins are not true InSpec plugins; we need to decorate them a
|
||||||
|
# bit more to integrate them. Wait to do this until after we know if
|
||||||
|
# they are system or user.
|
||||||
|
registry.each do |plugin_name, status|
|
||||||
|
fixup_train_plugin_status(status) if train_plugin_name?(plugin_name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_all
|
def load_all
|
||||||
|
@ -256,10 +263,6 @@ module Inspec::Plugin::V2
|
||||||
status.entry_point = plugin_entry[:installation_path]
|
status.entry_point = plugin_entry[:installation_path]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Train plugins are not true InSpec plugins; we need to decorate them a
|
|
||||||
# bit more to integrate them.
|
|
||||||
fixup_train_plugin_status(status) if train_plugin_name?(plugin_entry[:name])
|
|
||||||
|
|
||||||
registry[status.name] = status
|
registry[status.name] = status
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -268,6 +271,8 @@ module Inspec::Plugin::V2
|
||||||
status.api_generation = :'train-1'
|
status.api_generation = :'train-1'
|
||||||
if status.installation_type == :user_gem
|
if status.installation_type == :user_gem
|
||||||
# Activate the gem. This allows train to 'require' the gem later.
|
# Activate the gem. This allows train to 'require' the gem later.
|
||||||
|
# This is not required for system gems because rubygems already has
|
||||||
|
# activated the gemspecs.
|
||||||
activate_managed_gems_for_plugin(status.entry_point)
|
activate_managed_gems_for_plugin(status.entry_point)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,8 +32,8 @@ class PluginManagerCliInstall < Minitest::Test
|
||||||
given: File.join("test", "fixtures", "plugins", "inspec-test-fixture", "lib", "inspec-test-fixture.rb"),
|
given: File.join("test", "fixtures", "plugins", "inspec-test-fixture", "lib", "inspec-test-fixture.rb"),
|
||||||
},
|
},
|
||||||
"refers_to_a_train_plugin" => {
|
"refers_to_a_train_plugin" => {
|
||||||
given: File.join(core_config_dir_path, "train-test-fixture", "gems", ruby_abi_version, "gems", "train-test-fixture-0.1.0", "lib", "train-test-fixture.rb"),
|
|
||||||
plugin_name: "train-test-fixture",
|
plugin_name: "train-test-fixture",
|
||||||
|
given: File.join(core_config_dir_path, "train-test-fixture", "gems", ruby_abi_version, "gems", "train-test-fixture-0.1.0", "lib", "train-test-fixture.rb"),
|
||||||
resolved_path: File.join(core_config_dir_path, "train-test-fixture", "gems", ruby_abi_version, "gems", "train-test-fixture-0.1.0", "lib", "train-test-fixture.rb"),
|
resolved_path: File.join(core_config_dir_path, "train-test-fixture", "gems", ruby_abi_version, "gems", "train-test-fixture-0.1.0", "lib", "train-test-fixture.rb"),
|
||||||
},
|
},
|
||||||
}.each do |test_name, fixture_info|
|
}.each do |test_name, fixture_info|
|
||||||
|
|
Loading…
Reference in a new issue