mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-09 18:26:30 +00:00
supervisor/backup: Ensure compressed flag is respected by homeassistant (#3839)
As per commit 80e67b3 we're supporting a compressed flag on backups to define whether a tar archive should be fully compressed or not, but while we respect this for all the addons and folders we don't do it for the actual homeassistant archive, that is always compressed despite the passed flag. Fix this by applying the same logic to the homeassistant archive too.
This commit is contained in:
parent
dcd0592d44
commit
2dab39bf90
@ -465,8 +465,11 @@ class Backup(CoreSysAttributes):
|
||||
self._data[ATTR_HOMEASSISTANT] = {ATTR_VERSION: self.sys_homeassistant.version}
|
||||
|
||||
# Backup Home Assistant Core config directory
|
||||
tar_name = Path(
|
||||
self._tmp.name, f"homeassistant.tar{'.gz' if self.compressed else ''}"
|
||||
)
|
||||
homeassistant_file = SecureTarFile(
|
||||
Path(self._tmp.name, "homeassistant.tar.gz"), "w", key=self._key
|
||||
tar_name, "w", key=self._key, gzip=self.compressed
|
||||
)
|
||||
|
||||
await self.sys_homeassistant.backup(homeassistant_file)
|
||||
@ -479,8 +482,11 @@ class Backup(CoreSysAttributes):
|
||||
await self.sys_homeassistant.core.stop()
|
||||
|
||||
# Restore Home Assistant Core config directory
|
||||
tar_name = Path(
|
||||
self._tmp.name, f"homeassistant.tar{'.gz' if self.compressed else ''}"
|
||||
)
|
||||
homeassistant_file = SecureTarFile(
|
||||
Path(self._tmp.name, "homeassistant.tar.gz"), "r", key=self._key
|
||||
tar_name, "r", key=self._key, gzip=self.compressed
|
||||
)
|
||||
|
||||
await self.sys_homeassistant.restore(homeassistant_file)
|
||||
|
Loading…
x
Reference in New Issue
Block a user