Don't remove add-on conifg on add-on removal (#4696)

This commit is contained in:
Stefan Agner 2023-11-11 13:23:35 +01:00 committed by GitHub
parent 6976a4cf2e
commit 5f4581042c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -602,10 +602,6 @@ class Addon(AddonModel):
_LOGGER.info("Removing add-on data folder %s", self.path_data) _LOGGER.info("Removing add-on data folder %s", self.path_data)
await remove_data(self.path_data) await remove_data(self.path_data)
if self.path_config.is_dir():
_LOGGER.info("Removing add-on config folder %s", self.path_config)
await remove_data(self.path_config)
@Job( @Job(
name="addon_install", name="addon_install",
limit=JobExecutionLimit.GROUP_ONCE, limit=JobExecutionLimit.GROUP_ONCE,

View File

@ -1420,9 +1420,12 @@ async def test_restore_preserves_data_config(
(test_config := install_addon_example.path_config / "config.yaml").touch() (test_config := install_addon_example.path_config / "config.yaml").touch()
backup: Backup = await coresys.backups.do_backup_partial(addons=["local_example"]) backup: Backup = await coresys.backups.do_backup_partial(addons=["local_example"])
(test_config2 := install_addon_example.path_config / "config2.yaml").touch()
await coresys.addons.uninstall("local_example") await coresys.addons.uninstall("local_example")
assert not install_addon_example.path_data.exists() assert not install_addon_example.path_data.exists()
assert not install_addon_example.path_config.exists() assert install_addon_example.path_config.exists()
assert test_config2.exists()
with patch.object(AddonModel, "_validate_availability"), patch.object( with patch.object(AddonModel, "_validate_availability"), patch.object(
DockerAddon, "attach" DockerAddon, "attach"
@ -1433,6 +1436,7 @@ async def test_restore_preserves_data_config(
assert test_data.exists() assert test_data.exists()
assert test_config.exists() assert test_config.exists()
assert not test_config2.exists()
async def test_backup_to_mount_bypasses_free_space_condition( async def test_backup_to_mount_bypasses_free_space_condition(