mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-28 19:46:29 +00:00
Handle empty Add-on backup properly (#3253)
* Handle empty Add-on backup properly Check if the data directory exist in the backup. If not, make sure a directory gets created so the options.json can be written afterwards. * Remove unrelated change
This commit is contained in:
parent
d2b706df05
commit
f07193dc3c
@ -859,7 +859,11 @@ class Addon(AddonModel):
|
|||||||
# Restore data
|
# Restore data
|
||||||
def _restore_data():
|
def _restore_data():
|
||||||
"""Restore data."""
|
"""Restore data."""
|
||||||
shutil.copytree(Path(temp, "data"), self.path_data, symlinks=True)
|
temp_data = Path(temp, "data")
|
||||||
|
if temp_data.is_dir():
|
||||||
|
shutil.copytree(temp_data, self.path_data, symlinks=True)
|
||||||
|
else:
|
||||||
|
self.path_data.mkdir()
|
||||||
|
|
||||||
_LOGGER.info("Restoring data for addon %s", self.slug)
|
_LOGGER.info("Restoring data for addon %s", self.slug)
|
||||||
if self.path_data.is_dir():
|
if self.path_data.is_dir():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user