From 208b46d94b4d11e555b5b2209e78a32886c4d03f Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 3 Dec 2015 23:25:36 -0500 Subject: [PATCH] add leniency for tests --- .../main/java/org/elasticsearch/plugins/PluginsService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/org/elasticsearch/plugins/PluginsService.java b/core/src/main/java/org/elasticsearch/plugins/PluginsService.java index a8ce09a46e2..cab0e1e6ff6 100644 --- a/core/src/main/java/org/elasticsearch/plugins/PluginsService.java +++ b/core/src/main/java/org/elasticsearch/plugins/PluginsService.java @@ -276,6 +276,10 @@ public class PluginsService extends AbstractComponent { // similar in impl to getPluginBundles, but DO NOT try to make them share code. // we don't need to inherit all the leniency, and things are different enough. static List getModuleBundles(Path modulesDirectory) throws IOException { + // damn leniency + if (Files.notExists(modulesDirectory)) { + return Collections.emptyList(); + } List bundles = new ArrayList<>(); try (DirectoryStream stream = Files.newDirectoryStream(modulesDirectory)) { for (Path module : stream) {