Skip to content
Permalink
Browse files
processing: fix unused variable error
  • Loading branch information
jef-n committed Feb 17, 2015
1 parent 1b0fb48 commit e2dd504
Showing 1 changed file with 4 additions and 2 deletions.
@@ -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.