mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-09-01 00:59:24 +00:00
Merge branch 'master' of https://github.com/zalando/governor into s3_backups
This commit is contained in:
+2
-2
@@ -47,7 +47,7 @@ class Etcd:
|
||||
def put_client_path(self, path, **data):
|
||||
try:
|
||||
response = requests.put(self.client_url(path), data=data)
|
||||
return response.status_code in [200, 201]
|
||||
return response.status_code in [200, 201, 202, 204]
|
||||
except:
|
||||
logger.exception('PUT %s data=%s', path, data)
|
||||
return False
|
||||
@@ -55,7 +55,7 @@ class Etcd:
|
||||
def delete_client_path(self, path):
|
||||
try:
|
||||
response = requests.delete(self.client_url(path))
|
||||
return response.status_code == 204
|
||||
return response.status_code in [200, 202, 204]
|
||||
except:
|
||||
logger.exception('DELETE %s', path)
|
||||
return False
|
||||
|
||||
@@ -95,12 +95,9 @@ class Postgresql:
|
||||
return not os.path.exists(self.data_dir) or os.listdir(self.data_dir) == []
|
||||
|
||||
def initialize(self):
|
||||
if os.system(self._pg_ctl + ' initdb --encoding=UTF8') == 0:
|
||||
self.write_pg_hba()
|
||||
|
||||
return True
|
||||
|
||||
return False
|
||||
ret = os.system(self._pg_ctl + ' initdb -o --encoding=UTF8') == 0
|
||||
ret and self.write_pg_hba()
|
||||
return ret
|
||||
|
||||
def sync_from_leader(self, leader):
|
||||
r = parseurl(leader.address)
|
||||
|
||||
Reference in New Issue
Block a user