Complete custom database port support

This commit is contained in:
Antoine Nguyen
2022-09-15 10:43:44 +02:00
parent 062ad0d9f3
commit 23ac0bf172
11 changed files with 22 additions and 15 deletions

View File

@@ -45,10 +45,12 @@ class Spamassassin(base.Installer):
context = super(Spamassassin, self).get_template_context()
if self.dbengine == "postgres":
store_module = "Mail::SpamAssassin::BayesStore::PgSQL"
dsn = "DBI:Pg:dbname={};host={}".format(self.dbname, self.dbhost)
dsn = "DBI:Pg:dbname={};host={};port={}".format(
self.dbname, self.dbhost, self.dbport)
else:
store_module = "Mail::SpamAssassin::BayesStore::MySQL"
dsn = "DBI:mysql:{}:{}".format(self.dbname, self.dbhost)
dsn = "DBI:mysql:{}:{}:{}".format(
self.dbname, self.dbhost, self.dbport)
context.update({
"store_module": store_module, "dsn": dsn, "dcc_enabled": "#"})
return context