From d4c77cf43daf55dd270d95d50f5bdb4e742bdc9a Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Sat, 7 Mar 2020 03:05:40 +0100 Subject: [PATCH] Bug: Properly resolve conainer service name --- src/restic_compose_backup/containers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/restic_compose_backup/containers.py b/src/restic_compose_backup/containers.py index a05e638..fbc2049 100644 --- a/src/restic_compose_backup/containers.py +++ b/src/restic_compose_backup/containers.py @@ -72,9 +72,7 @@ class Container: @property def service_name(self) -> str: """Name of the container/service""" - name = self.get_label('com.docker.compose.service', default='') - if not name: - return self.get_label('com.docker.swarm.service.name', default='') + return self.get_label('com.docker.compose.service', default='') or self.get_label('com.docker.swarm.service.name', default='') @property def backup_process_label(self) -> str: