mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
[refactor] Code cleanup pt. 2
This commit is contained in:
@@ -26,14 +26,16 @@ def mysql_conn(retry):
|
|||||||
try:
|
try:
|
||||||
_mysql.connect(
|
_mysql.connect(
|
||||||
host=mainip,
|
host=mainip,
|
||||||
user="root",
|
user='root',
|
||||||
passwd=__salt__['pillar.get']('secrets:mysql')
|
passwd=__salt__['pillar.get']('secrets:mysql')
|
||||||
)
|
)
|
||||||
|
log.debug(f'Connected to MySQL server on {mainip} after {retry} attempts.')
|
||||||
mysql_up = True
|
mysql_up = True
|
||||||
break
|
break
|
||||||
except _mysql.OperationalError as e:
|
except _mysql.OperationalError as e:
|
||||||
log.debug(e)
|
log.debug(e)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
log.error('Unexpected error occured.')
|
||||||
log.error(e)
|
log.error(e)
|
||||||
break
|
break
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user