Skip to content
Permalink
Browse files

[processing] avoid exception when listing DB schemas

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 28, 2019
1 parent 5b02e43 commit 11435027a2fb39d510a6ae3b84e71c330a9c2217
Showing with 12 additions and 3 deletions.
  1. +12 −3 python/plugins/processing/tools/postgis.py
@@ -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()

0 comments on commit 1143502

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