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
end end
# Load v2 plugins # Load v2 plugins. Manually check for plugin disablement.
v2_loader = Inspec::Plugin::V2::Loader.new 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.load_all
v2_loader.exit_on_load_error v2_loader.exit_on_load_error
v2_loader.activate_mentioned_cli_plugins v2_loader.activate_mentioned_cli_plugins

View file

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