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.
This commit is contained in:
Ryan Ernst 2017-04-19 09:09:34 -07:00 committed by GitHub
parent 688fa309bc
commit c7e9231a86
2 changed files with 0 additions and 14 deletions

View File

@ -205,11 +205,6 @@ class InstallPluginCommand extends EnvironmentAwareCommand {
if (pluginId == null) {
throw new UserException(ExitCodes.USAGE, "plugin id is required");
}
// TODO: remove this leniency!! is it needed anymore?
if (Files.exists(env.pluginsFile()) == false) {
terminal.println("Plugins directory [" + env.pluginsFile() + "] does not exist. Creating...");
Files.createDirectory(env.pluginsFile());
}
Path pluginZip = download(terminal, pluginId, env.tmpFile());
Path extractedZip = unzip(pluginZip, env.pluginsFile());

View File

@ -345,15 +345,6 @@ public class InstallPluginCommandTests extends ESTestCase {
assertTrue(e.getMessage(), e.getMessage().contains("Unknown plugin foo"));
}
public void testPluginsDirMissing() throws Exception {
Tuple<Path, Environment> env = createEnv(fs, temp);
Files.delete(env.v2().pluginsFile());
Path pluginDir = createPluginDir(temp);
String pluginZip = createPlugin("fake", pluginDir);
installPlugin(pluginZip, env.v1());
assertPlugin("fake", pluginDir, env.v2());
}
public void testPluginsDirReadOnly() throws Exception {
assumeTrue("posix and filesystem", isPosix && isReal);
Tuple<Path, Environment> env = createEnv(fs, temp);