Don't remove folder itself on restore (#4654)

* Don't remove folder itself on restore

* Allow dirs exist on copytree
This commit is contained in:
Mike Degatano 2023-10-30 03:42:23 -04:00 committed by GitHub
parent 0f600da096
commit a8f818fca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -427,7 +427,7 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
temp_data,
self.sys_config.path_homeassistant,
symlinks=True,
dirs_exist_ok=bool(excludes),
dirs_exist_ok=True,
)
_LOGGER.info("Restore Home Assistant Core config folder")
@ -436,7 +436,7 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
)
await remove_folder(
self.sys_config.path_homeassistant,
content_only=bool(excludes),
content_only=True,
excludes=excludes,
tmp_dir=self.sys_config.path_tmp,
)