mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-20 07:36:29 +00:00
Overwrite snapshot if slug allready exsist (#2146)
This commit is contained in:
parent
c6e3787681
commit
9744f3354b
@ -98,8 +98,10 @@ class SnapshotManager(CoreSysAttributes):
|
|||||||
|
|
||||||
# Already exists?
|
# Already exists?
|
||||||
if snapshot.slug in self.snapshots_obj:
|
if snapshot.slug in self.snapshots_obj:
|
||||||
_LOGGER.error("Snapshot %s already exists!", snapshot.slug)
|
_LOGGER.warning(
|
||||||
return None
|
"Snapshot %s already exists! overwriting snapshot", snapshot.slug
|
||||||
|
)
|
||||||
|
self.remove(self.get(snapshot.slug))
|
||||||
|
|
||||||
# Move snapshot to backup
|
# Move snapshot to backup
|
||||||
tar_origin = Path(self.sys_config.path_backup, f"{snapshot.slug}.tar")
|
tar_origin = Path(self.sys_config.path_backup, f"{snapshot.slug}.tar")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user