mirror of
https://github.com/elastic/logstash.git
synced 2025-04-25 23:27:19 -04:00
This PR fix an annoyance when running the `bin/logstash-plugin install --no-verify` without any plugins, the command was making an unnecessary call to the artifacts web server. Fixes #6826
25 lines
739 B
Ruby
25 lines
739 B
Ruby
# encoding: utf-8
|
|
require "pluginmanager/ui"
|
|
require "pluginmanager/pack_fetch_strategy/repository"
|
|
require "pluginmanager/pack_fetch_strategy/uri"
|
|
|
|
module LogStash module PluginManager
|
|
class InstallStrategyFactory
|
|
AVAILABLES_STRATEGIES = [
|
|
LogStash::PluginManager::PackFetchStrategy::Uri,
|
|
LogStash::PluginManager::PackFetchStrategy::Repository
|
|
]
|
|
|
|
def self.create(plugins_args)
|
|
plugin_name_or_uri = plugins_args.first
|
|
return false if plugin_name_or_uri.nil? || plugin_name_or_uri.strip.empty?
|
|
|
|
AVAILABLES_STRATEGIES.each do |strategy|
|
|
if installer = strategy.get_installer_for(plugin_name_or_uri)
|
|
return installer
|
|
end
|
|
end
|
|
return false
|
|
end
|
|
end
|
|
end end
|