Merge branch 'master' of https://github.com/zalando/governor into s3_backups

This commit is contained in:
Oleksii Kliukin
2015-05-20 17:09:39 +02:00
9 changed files with 571 additions and 8 deletions
+2 -2
View File
@@ -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
+3 -6
View File
@@ -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)