From 9744f3354bae5ada7f10efd087bb753b59d4ec71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Mon, 19 Oct 2020 13:57:58 +0200 Subject: [PATCH] Overwrite snapshot if slug allready exsist (#2146) --- supervisor/snapshots/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/supervisor/snapshots/__init__.py b/supervisor/snapshots/__init__.py index a4a3f4adf..f477a105a 100644 --- a/supervisor/snapshots/__init__.py +++ b/supervisor/snapshots/__init__.py @@ -98,8 +98,10 @@ class SnapshotManager(CoreSysAttributes): # Already exists? if snapshot.slug in self.snapshots_obj: - _LOGGER.error("Snapshot %s already exists!", snapshot.slug) - return None + _LOGGER.warning( + "Snapshot %s already exists! overwriting snapshot", snapshot.slug + ) + self.remove(self.get(snapshot.slug)) # Move snapshot to backup tar_origin = Path(self.sys_config.path_backup, f"{snapshot.slug}.tar")