bug: Don't include volumes from containers with only database backup

This commit is contained in:
Einar Forselv 2019-11-26 14:23:54 +01:00
parent aa7271c159
commit ab7e4f4aeb
1 changed files with 3 additions and 2 deletions

View File

@ -267,10 +267,11 @@ class RunningContainers:
"""Obtain all containers with backup enabled""" """Obtain all containers with backup enabled"""
return [container for container in self.containers if container.backup_enabled] return [container for container in self.containers if container.backup_enabled]
def generate_backup_mounts(self, dest_prefix) -> dict: def generate_backup_mounts(self, dest_prefix='/backup') -> dict:
mounts = {} mounts = {}
for container in self.containers_for_backup(): for container in self.containers_for_backup():
mounts.update(container.volumes_for_backup(source_prefix=dest_prefix, mode='ro')) if container.volume_backup_enabled:
mounts.update(container.volumes_for_backup(source_prefix=dest_prefix, mode='ro'))
return mounts return mounts