Skip to content

Commit

Permalink
explicitly call QgsDataSourceURI.connectionInfo() with appropriate pa…
Browse files Browse the repository at this point in the history
…rameter
  • Loading branch information
SebDieBln authored and luipir committed Jan 13, 2016
1 parent 93ab890 commit ef91882
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/oracle/connector.py
Expand Up @@ -125,7 +125,7 @@ def __init__(self, uri, connName):
self._checkGeometryColumnsTable()

def _connectionInfo(self):
return unicode(self._uri.connectionInfo())
return unicode(self._uri.connectionInfo(True))

def _checkSpatial(self):
"""Check whether Oracle Spatial is present in catalog."""
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/oracle/plugin.py
Expand Up @@ -129,7 +129,7 @@ def connect(self, parent=None):
max_attempts = 3
for i in range(max_attempts):
(ok, username, password) = QgsCredentials.instance().get(
uri.connectionInfo(), username, password, err)
uri.connectionInfo(False), username, password, err)

if not ok:
return False
Expand All @@ -145,7 +145,7 @@ def connect(self, parent=None):
continue

QgsCredentials.instance().put(
uri.connectionInfo(), username, password)
uri.connectionInfo(False), username, password)

return True

Expand Down
6 changes: 3 additions & 3 deletions python/plugins/db_manager/db_plugins/postgis/connector.py
Expand Up @@ -56,7 +56,7 @@ def __init__(self, uri):
except self.connection_error_types() as e:
err = unicode(e)
uri = self.uri()
conninfo = uri.connectionInfo()
conninfo = uri.connectionInfo(False)

for i in range(3):
(ok, username, password) = QgsCredentials.instance().get(conninfo, username, password, err)
Expand All @@ -70,7 +70,7 @@ def __init__(self, uri):
uri.setPassword(password)

try:
self.connection = psycopg2.connect(uri.connectionInfo().encode('utf-8'))
self.connection = psycopg2.connect(uri.connectionInfo(True).encode('utf-8'))
QgsCredentials.instance().put(conninfo, username, password)
except self.connection_error_types() as e:
if i == 2:
Expand All @@ -90,7 +90,7 @@ def __init__(self, uri):
self._checkRasterColumnsTable()

def _connectionInfo(self):
return unicode(self.uri().connectionInfo())
return unicode(self.uri().connectionInfo(True))

def _checkSpatial(self):
""" check whether postgis_version is present in catalog """
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/postgis/plugin.py
Expand Up @@ -292,7 +292,7 @@ def toMapLayer(self):
if not rl.isValid():
err = rl.error().summary()
uri = QgsDataSourceURI(self.database().uri())
conninfo = uri.connectionInfo()
conninfo = uri.connectionInfo(False)
username = uri.username()
password = uri.password()

Expand Down

0 comments on commit ef91882

Please sign in to comment.