Allow inclusion of project name in backup path

This commit is contained in:
Jannik
2020-05-26 14:30:59 +02:00
parent f59a046bbc
commit 18ddb173ac
5 changed files with 50 additions and 5 deletions

View File

@@ -231,7 +231,17 @@ class Container:
return volumes
def get_volume_backup_destination(self, mount, source_prefix) -> str:
return str(Path(source_prefix) / self.service_name / Path(utils.strip_root(mount.destination)))
destination = Path(source_prefix)
if utils.is_true(config.include_project_name):
project_name = self.project_name
if project_name != '':
destination /= project_name
destination /= self.service_name
destination /= Path(utils.strip_root(mount.destination))
return str(destination)
def get_credentials(self) -> dict:
"""dict: get credentials for the service"""