Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] avoid exception when listing DB schemas
do not fail if cert file cannot be deleted when creating GeoDB object

fixes #21099
  • Loading branch information
volaya authored and nyalldawson committed Jan 28, 2019
1 parent 2c69483 commit 1b4a913
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions python/plugins/processing/tools/postgis.py
Expand Up @@ -222,17 +222,26 @@ def __init__(self, host=None, port=None, dbname=None, user=None,
sslCertFile = expandedUri.param("sslcert")
if sslCertFile:
sslCertFile = sslCertFile.replace("'", "")
os.remove(sslCertFile)
try:
os.remove(sslCertFile)
except OSError:
pass

sslKeyFile = expandedUri.param("sslkey")
if sslKeyFile:
sslKeyFile = sslKeyFile.replace("'", "")
os.remove(sslKeyFile)
try:
os.remove(sslKeyFile)
except OSError:
pass

sslCAFile = expandedUri.param("sslrootcert")
if sslCAFile:
sslCAFile = sslCAFile.replace("'", "")
os.remove(sslCAFile)
try:
os.remove(sslCAFile)
except OSError:
pass

self.has_postgis = self.check_postgis()

Expand Down

0 comments on commit 1b4a913

Please sign in to comment.