diff --git a/patroni/postgresql.py b/patroni/postgresql.py index aecc8040..84b8963c 100644 --- a/patroni/postgresql.py +++ b/patroni/postgresql.py @@ -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