Skip to content

Commit c7e9231

Browse files
authored
Plugins: Remove leniency for missing plugins dir (#24173)
This leniency was left in after plugin installer refactoring for 2.0 because some tests still relied on it. However, the need for this leniency no longer exists.
1 parent 688fa30 commit c7e9231

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

core/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ void execute(Terminal terminal, String pluginId, boolean isBatch, Environment en
205205
if (pluginId == null) {
206206
throw new UserException(ExitCodes.USAGE, "plugin id is required");
207207
}
208-
// TODO: remove this leniency!! is it needed anymore?
209-
if (Files.exists(env.pluginsFile()) == false) {
210-
terminal.println("Plugins directory [" + env.pluginsFile() + "] does not exist. Creating...");
211-
Files.createDirectory(env.pluginsFile());
212-
}
213208

214209
Path pluginZip = download(terminal, pluginId, env.tmpFile());
215210
Path extractedZip = unzip(pluginZip, env.pluginsFile());

qa/evil-tests/src/test/java/org/elasticsearch/plugins/InstallPluginCommandTests.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,6 @@ public void testUnknownPlugin() throws Exception {
345345
assertTrue(e.getMessage(), e.getMessage().contains("Unknown plugin foo"));
346346
}
347347

348-
public void testPluginsDirMissing() throws Exception {
349-
Tuple<Path, Environment> env = createEnv(fs, temp);
350-
Files.delete(env.v2().pluginsFile());
351-
Path pluginDir = createPluginDir(temp);
352-
String pluginZip = createPlugin("fake", pluginDir);
353-
installPlugin(pluginZip, env.v1());
354-
assertPlugin("fake", pluginDir, env.v2());
355-
}
356-
357348
public void testPluginsDirReadOnly() throws Exception {
358349
assumeTrue("posix and filesystem", isPosix && isReal);
359350
Tuple<Path, Environment> env = createEnv(fs, temp);

0 commit comments

Comments
 (0)