revert: use built-in env variables

This commit is contained in:
Michael Reichenbach 2021-03-08 16:32:52 +01:00 committed by Silthus
parent dc2103b3a2
commit 5eca6008aa

View file

@ -16,8 +16,8 @@ class MariadbContainer(Container):
"""dict: get credentials for the service""" """dict: get credentials for the service"""
return { return {
'host': self.hostname, 'host': self.hostname,
'username': self.get_config_env('BACKUP_MYSQL_USER'), 'username': self.get_config_env('MYSQL_USER'),
'password': self.get_config_env('BACKUP_MYSQL_PASSWORD'), 'password': self.get_config_env('MYSQL_PASSWORD'),
'port': "3306", 'port': "3306",
} }
@ -25,7 +25,7 @@ class MariadbContainer(Container):
"""Check the availability of the service""" """Check the availability of the service"""
creds = self.get_credentials() creds = self.get_credentials()
with utils.environment('BACKUP_MYSQL_PASSWORD', creds['password']): with utils.environment('MYSQL_PASSWORD', creds['password']):
return commands.ping_mariadb( return commands.ping_mariadb(
creds['host'], creds['host'],
creds['port'], creds['port'],
@ -90,8 +90,8 @@ class MysqlContainer(Container):
"""dict: get credentials for the service""" """dict: get credentials for the service"""
return { return {
'host': self.hostname, 'host': self.hostname,
'username': self.get_config_env('BACKUP_MYSQL_USER'), 'username': self.get_config_env('MYSQL_USER'),
'password': self.get_config_env('BACKUP_MYSQL_PASSWORD'), 'password': self.get_config_env('MYSQL_PASSWORD'),
'port': "3306", 'port': "3306",
} }
@ -99,7 +99,7 @@ class MysqlContainer(Container):
"""Check the availability of the service""" """Check the availability of the service"""
creds = self.get_credentials() creds = self.get_credentials()
with utils.environment('BACKUP_MYSQL_PASSWORD', creds['password']): with utils.environment('MYSQL_PASSWORD', creds['password']):
return commands.ping_mysql( return commands.ping_mysql(
creds['host'], creds['host'],
creds['port'], creds['port'],
@ -165,10 +165,10 @@ class PostgresContainer(Container):
"""dict: get credentials for the service""" """dict: get credentials for the service"""
return { return {
'host': self.hostname, 'host': self.hostname,
'username': self.get_config_env('BACKUP_POSTGRES_USER'), 'username': self.get_config_env('POSTGRES_USER'),
'password': self.get_config_env('BACKUP_POSTGRES_PASSWORD'), 'password': self.get_config_env('POSTGRES_PASSWORD'),
'port': "5432", 'port': "5432",
'database': self.get_config_env('BACKUP_POSTGRES_DB'), 'database': self.get_config_env('POSTGRES_DB'),
} }
def ping(self) -> bool: def ping(self) -> bool: