Skip to content

Commit

Permalink
processing: fix unused variable error
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 17, 2015
1 parent 1b0fb48 commit e2dd504
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/plugins/processing/algs/gdal/OgrAlgorithm.py
Expand Up @@ -56,8 +56,8 @@ def ogrConnectionString(self, uri):
# table="t4" (geom) sql=
dsUri = QgsDataSourceURI(layer.dataProvider().dataSourceUri())
conninfo = dsUri.connectionInfo()

conn = None
ok = False
while not conn:
try:
conn = psycopg2.connect(dsUri.connectionInfo())
Expand All @@ -72,7 +72,9 @@ def ogrConnectionString(self, uri):
if not conn:
raise RuntimeError('Could not connect to PostgreSQL database - check connection info')

QgsCredentials.instance().put(conninfo, user, passwd)
if ok:
QgsCredentials.instance().put(conninfo, user, passwd)

ogrstr = "PG:%s" % dsUri.connectionInfo()
else:
ogrstr = unicode(layer.source()).split("|")[0]
Expand Down

0 comments on commit e2dd504

Please sign in to comment.