fix: ping db with password
This commit is contained in:
parent
1f4d81e319
commit
b02376354c
3 changed files with 18 additions and 14 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 1fabdf87e3007e5934227b504ad673ba3697946c
|
Subproject commit bedaa052d3d187fac62a38b19659ef12242e2528
|
|
@ -9,7 +9,7 @@ def test():
|
||||||
return run(['ls', '/volumes'])
|
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"""
|
"""Check if the mysql is up and can be reached"""
|
||||||
return run([
|
return run([
|
||||||
'mysqladmin',
|
'mysqladmin',
|
||||||
|
@ -20,6 +20,8 @@ def ping_mysql(host, port, username) -> int:
|
||||||
port,
|
port,
|
||||||
'--user',
|
'--user',
|
||||||
username,
|
username,
|
||||||
|
'--password',
|
||||||
|
password
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,6 +36,8 @@ def ping_mariadb(host, port, username) -> int:
|
||||||
port,
|
port,
|
||||||
'--user',
|
'--user',
|
||||||
username,
|
username,
|
||||||
|
'--password',
|
||||||
|
password
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,11 @@ 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('MYSQL_PASSWORD', creds['password']):
|
|
||||||
return commands.ping_mariadb(
|
return commands.ping_mariadb(
|
||||||
creds['host'],
|
creds['host'],
|
||||||
creds['port'],
|
creds['port'],
|
||||||
creds['username'],
|
creds['username'],
|
||||||
|
creds['password']
|
||||||
)
|
)
|
||||||
|
|
||||||
def dump_command(self) -> list:
|
def dump_command(self) -> list:
|
||||||
|
@ -100,11 +100,11 @@ 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('MYSQL_PASSWORD', creds['password']):
|
|
||||||
return commands.ping_mysql(
|
return commands.ping_mysql(
|
||||||
creds['host'],
|
creds['host'],
|
||||||
creds['port'],
|
creds['port'],
|
||||||
creds['username'],
|
creds['username'],
|
||||||
|
creds['password']
|
||||||
)
|
)
|
||||||
|
|
||||||
def dump_command(self) -> list:
|
def dump_command(self) -> list:
|
||||||
|
|
Loading…
Add table
Reference in a new issue