mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-12-13 09:24:56 +00:00
fix: ping db with password
This commit is contained in:
Submodule src/mydumper updated: 1fabdf87e3...bedaa052d3
@@ -9,7 +9,7 @@ def test():
|
||||
return run(['ls', '/volumes'])
|
||||
|
||||
|
||||
def ping_mysql(host, port, username) -> int:
|
||||
def ping_mysql(host, port, username, password) -> int:
|
||||
"""Check if the mysql is up and can be reached"""
|
||||
return run([
|
||||
'mysqladmin',
|
||||
@@ -20,6 +20,8 @@ def ping_mysql(host, port, username) -> int:
|
||||
port,
|
||||
'--user',
|
||||
username,
|
||||
'--password',
|
||||
password
|
||||
])
|
||||
|
||||
|
||||
@@ -34,6 +36,8 @@ def ping_mariadb(host, port, username) -> int:
|
||||
port,
|
||||
'--user',
|
||||
username,
|
||||
'--password',
|
||||
password
|
||||
])
|
||||
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ class MariadbContainer(Container):
|
||||
"""Check the availability of the service"""
|
||||
creds = self.get_credentials()
|
||||
|
||||
with utils.environment('MYSQL_PASSWORD', creds['password']):
|
||||
return commands.ping_mariadb(
|
||||
creds['host'],
|
||||
creds['port'],
|
||||
creds['username'],
|
||||
)
|
||||
return commands.ping_mariadb(
|
||||
creds['host'],
|
||||
creds['port'],
|
||||
creds['username'],
|
||||
creds['password']
|
||||
)
|
||||
|
||||
def dump_command(self) -> list:
|
||||
"""list: create a dump command restic and use to send data through stdin"""
|
||||
@@ -100,12 +100,12 @@ class MysqlContainer(Container):
|
||||
"""Check the availability of the service"""
|
||||
creds = self.get_credentials()
|
||||
|
||||
with utils.environment('MYSQL_PASSWORD', creds['password']):
|
||||
return commands.ping_mysql(
|
||||
creds['host'],
|
||||
creds['port'],
|
||||
creds['username'],
|
||||
)
|
||||
return commands.ping_mysql(
|
||||
creds['host'],
|
||||
creds['port'],
|
||||
creds['username'],
|
||||
creds['password']
|
||||
)
|
||||
|
||||
def dump_command(self) -> list:
|
||||
"""list: create a dump command restic and use to send data through stdin"""
|
||||
|
||||
Reference in New Issue
Block a user