mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
[feat] Also run query against mysql to ensure queries can complete
This commit is contained in:
@@ -24,12 +24,14 @@ def mysql_conn(retry):
|
||||
for i in range(0, retry):
|
||||
log.debug(f'Connection attempt {i+1}')
|
||||
try:
|
||||
_mysql.connect(
|
||||
db = _mysql.connect(
|
||||
host=mainip,
|
||||
user='root',
|
||||
passwd=__salt__['pillar.get']('secrets:mysql')
|
||||
)
|
||||
log.debug(f'Connected to MySQL server on {mainip} after {retry} attempts.')
|
||||
log.debug(f'Connected to MySQL server on {mainip} after {i} attempts.')
|
||||
db.query("""SELECT 1;""")
|
||||
log.debug(f'Successfully completed query against MySQL server on {mainip}')
|
||||
mysql_up = True
|
||||
break
|
||||
except _mysql.OperationalError as e:
|
||||
|
||||
Reference in New Issue
Block a user