check if output lines of controldata are possible to split (#797)

Otherwise it fails with scary stacktrace
This commit is contained in:
anikin-aa
2018-08-29 16:06:06 +02:00
committed by Alexander Kukushkin
parent 90cf930036
commit 68c0d87d42
+2 -1
View File
@@ -1216,7 +1216,8 @@ class Postgresql(object):
if data:
data = data.decode('utf-8').splitlines()
# pg_controldata output depends on major verion. Some of parameters are prefixed by 'Current '
result = {l.split(':')[0].replace('Current ', '', 1): l.split(':', 1)[1].strip() for l in data if l}
result = {l.split(':')[0].replace('Current ', '', 1): l.split(':', 1)[1].strip() for l in data
if l and ':' in l}
except subprocess.CalledProcessError:
logger.exception("Error when calling pg_controldata")
return result