Skip to content
Permalink
Browse files

processing: fix unused variable error

  • Loading branch information
jef-n committed Feb 17, 2015
1 parent 1b0fb48 commit e2dd504377eb40dac3e6a518b27bf9665d707218
Showing with 4 additions and 2 deletions.
  1. +4 −2 python/plugins/processing/algs/gdal/OgrAlgorithm.py
@@ -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())
@@ -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]

0 comments on commit e2dd504

Please sign in to comment.
You can’t perform that action at this time.