From bad6f6022d23a5ea2a07f2d1028045dbe0ded12f Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Wed, 6 Dec 2023 16:42:38 +0100 Subject: [PATCH] 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 --- ngcp-update-db-schema | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/ngcp-update-db-schema b/ngcp-update-db-schema index 535d043d..d6be1b10 100755 --- a/ngcp-update-db-schema +++ b/ngcp-update-db-schema @@ -358,7 +358,7 @@ def connect_db() -> Connection: # type: ignore except pymysql.Error as e: error( '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) elif db_connect_method == 'config': @@ -376,17 +376,6 @@ def connect_db() -> Connection: # type: ignore error(f'cannot access {db_defaults_conf_file}: {e}') 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: db_conn: Connection = pymysql.connect( # type: ignore host=db_host,