Skip to content

Commit

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

fixes #21099

(cherry picked from commit 1b4a913)
  • Loading branch information
volaya authored and nyalldawson committed Jan 29, 2019
1 parent 5b02e43 commit 1143502
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") sslCertFile = expandedUri.param("sslcert")
if sslCertFile: if sslCertFile:
sslCertFile = sslCertFile.replace("'", "") sslCertFile = sslCertFile.replace("'", "")
os.remove(sslCertFile) try:
os.remove(sslCertFile)
except OSError:
pass


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


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


self.has_postgis = self.check_postgis() self.has_postgis = self.check_postgis()


Expand Down

0 comments on commit 1143502

Please sign in to comment.