mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-10-10 20:27:42 +00:00
List all containers including non-running ones
This commit is contained in:
@@ -142,7 +142,7 @@ class Container:
|
||||
|
||||
@property
|
||||
def is_running(self) -> bool:
|
||||
"""Is the container running?"""
|
||||
"""bool: Is the container running?"""
|
||||
return self._state.get('Running', False)
|
||||
|
||||
@property
|
||||
@@ -326,10 +326,14 @@ class RunningContainers:
|
||||
if not self.this_container:
|
||||
raise ValueError("Cannot find metadata for backup container")
|
||||
|
||||
# Gather all containers in the current compose setup
|
||||
# Gather all running containers in the current compose setup
|
||||
for container_data in all_containers:
|
||||
container = Container(container_data)
|
||||
|
||||
# We only care about running containers
|
||||
if not container.is_running:
|
||||
continue
|
||||
|
||||
# Detect running backup process container
|
||||
if container.is_backup_process_container:
|
||||
self.backup_process_container = container
|
||||
|
Reference in New Issue
Block a user