MT#58395 do not start mariadb with config connect method

* it's not a responsiblity of the script to start/stop
  any external services and therefore, mariadb start
  is removed

Change-Id: I220ebab7764a7016b15e6f08a8ac5ae01fe08523
mr12.2
Kirill Solomko 2 years ago
parent fd55aebd4c
commit bad6f6022d

@ -358,7 +358,7 @@ def connect_db() -> Connection: # type: ignore
except pymysql.Error as e: except pymysql.Error as e:
error( error(
'could not connect to database %s:%d via socket %s as %s: %s' % 'could not connect to database %s:%d via socket %s as %s: %s' %
(db_host, db_port, db_connect_method, db_user, e) (db_host, db_port, db_socket, db_user, e)
) )
shutdown(1) shutdown(1)
elif db_connect_method == 'config': elif db_connect_method == 'config':
@ -376,17 +376,6 @@ def connect_db() -> Connection: # type: ignore
error(f'cannot access {db_defaults_conf_file}: {e}') error(f'cannot access {db_defaults_conf_file}: {e}')
shutdown(1) shutdown(1)
cmd: List[str] = ['ngcp-service', 'start', 'mariadb']
try:
debug(f'run_cmd as: {cmd}')
stdout, stderr = run_cmd(*tuple(cmd))
log(stdout.decode())
if stderr:
raise ChildProcessError(stderr.decode())
except ChildProcessError as e:
error(f'could start mariadb service: {e}')
shutdown(1)
try: try:
db_conn: Connection = pymysql.connect( # type: ignore db_conn: Connection = pymysql.connect( # type: ignore
host=db_host, host=db_host,

Loading…
Cancel
Save