Try to guess the postgres role before it is started by examinging the recovery.conf.

This commit is contained in:
Oleksii Kliukin
2016-04-15 09:34:34 +02:00
parent 309b5d4803
commit 0de3a6ece4
+1 -1
View File
@@ -79,7 +79,7 @@ class Postgresql(object):
self._state = 'stopped'
self._state_lock = Lock()
self._role = 'replica'
self._role = 'replica' if os.path.exists(self.recovery_conf) else 'master'
self._role_lock = Lock()
if self.is_running():