From 44ed5956b0ef0ddd931224d2172ff52f9554f242 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Mon, 29 Apr 2019 04:26:55 +0200 Subject: [PATCH] Check for new container labels --- restic_volume_backup/containers.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/restic_volume_backup/containers.py b/restic_volume_backup/containers.py index 20c70c6..e303212 100644 --- a/restic_volume_backup/containers.py +++ b/restic_volume_backup/containers.py @@ -61,7 +61,23 @@ class Container: @property def backup_enabled(self) -> bool: """Is backup enabled for this container?""" - return self.get_label('restic-volume-backup.enabled') is not None + return any([ + self.volume_backup_enabled, + self.mysql_backup_enabled, + self.postgresql_backup_enabled, + ]) + + @property + def volume_backup_enabled(self): + return utils.is_true(self.get_label('restic-volume-backup.volumes')) + + @property + def mysql_backup_enabled(self): + return utils.is_true(self.get_label('restic-volume-backup.mysql')) + + @property + def postgresql_backup_enabled(self): + return utils.is_true(self.get_label('restic-volume-backup.postgresql')) @property def is_backup_process_container(self) -> bool: