db_port setting missing (#11284)

If db_port is set in the config.php, services-wrapper will not work.
This fixes the issue and adds a check if db_port is set to be used as the DB port when connecting.
I used 'if SETTING in config' method as this is used below in the script.
This commit is contained in:
Danislav 2020-03-13 20:37:45 +01:00 committed by GitHub
parent 75f741ca09
commit c9e90cc827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,9 @@ elif config['db_socket']:
elif ':' in config['db_host']:
db_server = config['db_host'].rsplit(':')[0]
db_port = int(config['db_host'].rsplit(':')[1])
elif 'db_port' in config:
db_server = config['db_host']
db_port = config['db_port']
else:
db_server = config['db_host']
db_port = 0