autodetect the host role during start from the existence of recovery.conf.

This commit is contained in:
Oleksii Kliukin
2015-06-03 16:13:03 +02:00
parent 1d3a946ffb
commit e06cd49deb
+4
View File
@@ -245,6 +245,10 @@ class Postgresql:
ret = subprocess.call(self._pg_ctl + ['start', '-o', self.server_options()]) == 0
ret and self.load_replication_slots()
self.save_configuration_files()
if os.path.exists(self.recovery_conf):
self.on_change_callback('replica')
else:
self.on_change_callback('master')
return ret
def stop(self):