launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #29237
[Merge] ~cjwatson/launchpad:session-dbuser-none into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:session-dbuser-none into launchpad:master.
Commit message:
Allow setting launchpad_session.dbuser to None
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/430339
In a charmed deployment, the PostgreSQL charm will provide us with a full connection string including the user, and we won't want to override that. Allow setting `config.launchpad_session.dbuser` to None to disable the arrangements that currently let us override the user on a per-deployment basis. This has no effect on existing deployments.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:session-dbuser-none into launchpad:master.
diff --git a/lib/lp/services/webapp/adapter.py b/lib/lp/services/webapp/adapter.py
index 458d6e5..28423d1 100644
--- a/lib/lp/services/webapp/adapter.py
+++ b/lib/lp/services/webapp/adapter.py
@@ -530,7 +530,8 @@ class LaunchpadSessionDatabase(Postgres):
def raw_connect(self):
dsn = ConnectionString(config.launchpad_session.database)
- dsn.user = config.launchpad_session.dbuser
+ if config.launchpad_session.dbuser is not None:
+ dsn.user = config.launchpad_session.dbuser
self._dsn = str(dsn)
flags = _get_dirty_commit_flags()
raw_connection = super().raw_connect()