浏览代码

add leniency for tests

Robert Muir 10 年之前
父节点
当前提交
208b46d94b
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      core/src/main/java/org/elasticsearch/plugins/PluginsService.java

+ 4 - 0
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<Bundle> getModuleBundles(Path modulesDirectory) throws IOException {
+        // damn leniency
+        if (Files.notExists(modulesDirectory)) {
+            return Collections.emptyList();
+        }
         List<Bundle> bundles = new ArrayList<>();
         try (DirectoryStream<Path> stream = Files.newDirectoryStream(modulesDirectory)) {
             for (Path module : stream) {