[processing] avoid exception when listing DB schemas

do not fail if cert file cannot be deleted when creating GeoDB object

fixes #21099
This commit is contained in:
Víctor Olaya 2019-01-28 22:01:20 +01:00 committed by Nyall Dawson
parent 2c6948382d
commit 1b4a9132c2

View File

@ -222,17 +222,26 @@ class GeoDB(object):
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()