Commit 3c1beaee authored by Ate Douma's avatar Ate Douma

CMS-10203: [Forwardport 11.1] fix detection of possibly orphaned configuration files

Also fix running the Module.check() method for the defaultModule.

(cherry picked from commit c92caa73)
parent ff65b592
......@@ -63,10 +63,8 @@ public final class AutoExportModule implements DaemonModule {
} catch (Exception e) {
log.error("Failed to initialize auto export. Auto export will not be available", e);
}
for (Module module : processor.getModules()) {
module.check();
}
processor.checkModules();
}
@Override
......
......@@ -382,7 +382,10 @@ public class EventProcessor implements EventListener {
defaultModule.getExtension().export();
}
List<Module> getModules() {
return modules;
void checkModules() {
defaultModule.check();
for (Module module : modules) {
module.check();
}
}
}
......@@ -124,9 +124,9 @@ final class Module {
for (File file : directory.listFiles()) {
if (file.isDirectory()) {
detectOrphanedFiles(file, bootstrapFiles);
} else if (file.getName().endsWith(".xml") || file.getName().endsWith(".cnd") || file.getName().endsWith(".json") && !file.getName().endsWith("hippoecm-extension.xml")) {
} else if ((file.getName().endsWith(".xml") || file.getName().endsWith(".cnd") || file.getName().endsWith(".json")) && !file.getName().endsWith("hippoecm-extension.xml")) {
if (!bootstrapFiles.contains(file)) {
log.warn("Found orphaned bootstrap file {}", file.getPath());
log.warn("Detected possibly orphaned bootstrap configuration file {}", file.getPath());
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment