changeset f0fd19f99ffc in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=f0fd19f99ffc
description:
        Do not warn about single '/' as path in database uri

        This is a valid configuration according to the documentation.

        issue10101
diffstat:

 trytond/backend/postgresql/database.py |  2 +-
 trytond/backend/sqlite/database.py     |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 27b828ae299a -r f0fd19f99ffc trytond/backend/postgresql/database.py
--- a/trytond/backend/postgresql/database.py    Tue Apr 13 01:43:52 2021 +0200
+++ b/trytond/backend/postgresql/database.py    Tue Apr 13 01:45:30 2021 +0200
@@ -244,7 +244,7 @@
     @classmethod
     def _connection_params(cls, name):
         uri = parse_uri(config.get('database', 'uri'))
-        if uri.path:
+        if uri.path and uri.path != '/':
             warnings.warn("The path specified in the URI will be overridden")
         params = {
             'dsn': uri._replace(path=name).geturl(),
diff -r 27b828ae299a -r f0fd19f99ffc trytond/backend/sqlite/database.py
--- a/trytond/backend/sqlite/database.py        Tue Apr 13 01:43:52 2021 +0200
+++ b/trytond/backend/sqlite/database.py        Tue Apr 13 01:45:30 2021 +0200
@@ -402,7 +402,7 @@
     def _make_uri(self):
         uri = config.get('database', 'uri')
         base_uri = parse_uri(uri)
-        if base_uri.path:
+        if base_uri.path and base_uri.path != '/':
             warnings.warn("The path specified in the URI will be overridden")
 
         if self.name == ':memory:':

Reply via email to