Add option to configure DB port
This commit is contained in:
parent
18600b24c1
commit
e1e4245822
2 changed files with 4 additions and 1 deletions
|
|
@ -10,6 +10,7 @@
|
||||||
DBName = koji
|
DBName = koji
|
||||||
DBUser = koji
|
DBUser = koji
|
||||||
#DBHost = db.example.com
|
#DBHost = db.example.com
|
||||||
|
#DBPort = 5432
|
||||||
#DBPass = example_password
|
#DBPass = example_password
|
||||||
KojiDir = /mnt/koji
|
KojiDir = /mnt/koji
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -400,6 +400,7 @@ def load_config(environ):
|
||||||
['DBUser', 'string', None],
|
['DBUser', 'string', None],
|
||||||
['DBHost', 'string', None],
|
['DBHost', 'string', None],
|
||||||
['DBhost', 'string', None], # alias for backwards compatibility
|
['DBhost', 'string', None], # alias for backwards compatibility
|
||||||
|
['DBPort', 'integer', 5432],
|
||||||
['DBPass', 'string', None],
|
['DBPass', 'string', None],
|
||||||
['KojiDir', 'string', None],
|
['KojiDir', 'string', None],
|
||||||
|
|
||||||
|
|
@ -665,7 +666,8 @@ def server_setup(environ):
|
||||||
koji.db.provideDBopts(database=opts["DBName"],
|
koji.db.provideDBopts(database=opts["DBName"],
|
||||||
user=opts["DBUser"],
|
user=opts["DBUser"],
|
||||||
password=opts.get("DBPass", None),
|
password=opts.get("DBPass", None),
|
||||||
host=opts.get("DBHost", None))
|
host=opts.get("DBHost", None),
|
||||||
|
port=opts.get("DBPort", 5432))
|
||||||
except Exception:
|
except Exception:
|
||||||
tb_str = ''.join(traceback.format_exception(*sys.exc_info()))
|
tb_str = ''.join(traceback.format_exception(*sys.exc_info()))
|
||||||
logger.error(tb_str)
|
logger.error(tb_str)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue