mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-23 17:16:33 +00:00
Don't remove add-on conifg on add-on removal (#4696)
This commit is contained in:
parent
6976a4cf2e
commit
5f4581042c
@ -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,
|
||||||
|
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user