-
Bug
-
Resolution: Done
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
9056
Loading configurations from classpath in class FileModuleShardConfigProvider [1] does not work properly, because it tries to read from file name instead of file path.
This is code that read configs:
Config moduleShardsConfig = null;
if (moduleShardsFile.exists())
Config modulesConfig = null;
if (modulesFile.exists()) { LOG.info("modules config file exists - reading config from it"); modulesConfig = ConfigFactory.parseFile(modulesFile); } else { LOG.warn("modules configuration read from resource"); modulesConfig = ConfigFactory.load(modulesFile.getName()); // <------------------- }
And it should look something like this:
Config moduleShardsConfig = null;
if (moduleShardsFile.exists()) { LOG.info("module shards config file exists - reading config from it"); moduleShardsConfig = ConfigFactory.parseFile(moduleShardsFile); }
else
{ LOG.warn("module shards configuration read from resource"); final String path = moduleShardsFile.getPath().replace("\\", "/"); // in case of windows OS moduleShardsConfig = ConfigFactory.load(path); } Config modulesConfig = null;
if (modulesFile.exists())
else
{ LOG.warn("modules configuration read from resource"); final String path = modulesFile.getPath().replace("\\", "/"); // in case of windows OS modulesConfig = ConfigFactory.load(path); }[1] - org.opendaylight.controller.cluster.datastore.config.FileModuleShardConfigProvider