From 5eca6008aa83695e9cc38f498fdad4298392b959 Mon Sep 17 00:00:00 2001 From: Michael Reichenbach Date: Mon, 8 Mar 2021 16:32:52 +0100 Subject: [PATCH] revert: use built-in env variables --- src/restic_compose_backup/containers_db.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/restic_compose_backup/containers_db.py b/src/restic_compose_backup/containers_db.py index 39cb4f4..44fa9db 100644 --- a/src/restic_compose_backup/containers_db.py +++ b/src/restic_compose_backup/containers_db.py @@ -16,8 +16,8 @@ class MariadbContainer(Container): """dict: get credentials for the service""" return { 'host': self.hostname, - 'username': self.get_config_env('BACKUP_MYSQL_USER'), - 'password': self.get_config_env('BACKUP_MYSQL_PASSWORD'), + 'username': self.get_config_env('MYSQL_USER'), + 'password': self.get_config_env('MYSQL_PASSWORD'), 'port': "3306", } @@ -25,7 +25,7 @@ class MariadbContainer(Container): """Check the availability of the service""" creds = self.get_credentials() - with utils.environment('BACKUP_MYSQL_PASSWORD', creds['password']): + with utils.environment('MYSQL_PASSWORD', creds['password']): return commands.ping_mariadb( creds['host'], creds['port'], @@ -90,8 +90,8 @@ class MysqlContainer(Container): """dict: get credentials for the service""" return { 'host': self.hostname, - 'username': self.get_config_env('BACKUP_MYSQL_USER'), - 'password': self.get_config_env('BACKUP_MYSQL_PASSWORD'), + 'username': self.get_config_env('MYSQL_USER'), + 'password': self.get_config_env('MYSQL_PASSWORD'), 'port': "3306", } @@ -99,7 +99,7 @@ class MysqlContainer(Container): """Check the availability of the service""" creds = self.get_credentials() - with utils.environment('BACKUP_MYSQL_PASSWORD', creds['password']): + with utils.environment('MYSQL_PASSWORD', creds['password']): return commands.ping_mysql( creds['host'], creds['port'], @@ -165,10 +165,10 @@ class PostgresContainer(Container): """dict: get credentials for the service""" return { 'host': self.hostname, - 'username': self.get_config_env('BACKUP_POSTGRES_USER'), - 'password': self.get_config_env('BACKUP_POSTGRES_PASSWORD'), + 'username': self.get_config_env('POSTGRES_USER'), + 'password': self.get_config_env('POSTGRES_PASSWORD'), 'port': "5432", - 'database': self.get_config_env('BACKUP_POSTGRES_DB'), + 'database': self.get_config_env('POSTGRES_DB'), } def ping(self) -> bool: