diff --git a/core/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java b/core/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java index 75ab95414a2..aa224b3c7c3 100644 --- a/core/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java +++ b/core/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java @@ -134,9 +134,6 @@ class InstallPluginCommand extends SettingCommand { } } - // protocols allowed for direct url installation - private static final List URL_PROTOCOLS = Arrays.asList("http", "https", "file"); - private final OptionSpec batchOption; private final OptionSpec arguments; diff --git a/qa/evil-tests/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java b/qa/evil-tests/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java index 5c766018f13..fdf52da2634 100644 --- a/qa/evil-tests/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java +++ b/qa/evil-tests/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java @@ -307,6 +307,12 @@ public class InstallPluginCommandTests extends ESTestCase { assertTrue(e.getMessage(), e.getMessage().contains("no protocol")); } + public void testUnknownPlugin() throws Exception { + Tuple env = createEnv(fs, temp); + UserError e = expectThrows(UserError.class, () -> installPlugin("foo", env.v1())); + assertTrue(e.getMessage(), e.getMessage().contains("Unknown plugin foo")); + } + public void testPluginsDirMissing() throws Exception { Tuple env = createEnv(fs, temp); Files.delete(env.v2().pluginsFile());