fix upgrade error message if no managed persistence config exists (#5202)

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
This commit is contained in:
Mark Herwege
2025-12-17 00:42:51 +01:00
committed by GitHub
parent cbf43fdc9c
commit 3e494bb0f4
@@ -59,7 +59,12 @@ public class PersistenceUpgrader implements Upgrader {
Path persistenceJsonDatabasePath = userdataPath
.resolve(Path.of("jsondb", "org.openhab.core.persistence.PersistenceServiceConfiguration.json"));
logger.info("Setting default strategy on persistence configurations without strategy '{}'",
if (Files.notExists(persistenceJsonDatabasePath)) {
// No managed persistence configurations, so no need to upgrade
return true;
}
logger.info("Setting default strategy on managed persistence configurations without strategy '{}'",
persistenceJsonDatabasePath);
if (!Files.isWritable(persistenceJsonDatabasePath)) {