Crude implementation to watch for plugin disable options

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2019-01-24 23:12:26 -05:00
parent 167ada963e
commit 4203c02836
2 changed files with 8 additions and 4 deletions

View file

@ -378,8 +378,10 @@ begin
end
end
# Load v2 plugins
v2_loader = Inspec::Plugin::V2::Loader.new
# Load v2 plugins. Manually check for plugin disablement.
omit_core = ARGV.delete('--disable-core-plugins')
omit_user = ARGV.delete('--disable-user-plugins')
v2_loader = Inspec::Plugin::V2::Loader.new(omit_core_plugins: omit_core, omit_user_plugins: omit_user)
v2_loader.load_all
v2_loader.exit_on_load_error
v2_loader.activate_mentioned_cli_plugins

View file

@ -14,8 +14,10 @@ module Inspec::Plugin::V2
def initialize(options = {})
@options = options
@registry = Inspec::Plugin::V2::Registry.instance
@conf_file = Inspec::Plugin::V2::ConfigFile.new
read_conf_file_into_registry
unless options[:omit_user_plugins]
@conf_file = Inspec::Plugin::V2::ConfigFile.new
read_conf_file_into_registry
end
# Old-style (v0, v1) co-distributed plugins were called 'bundles'
# and were located in lib/bundles