Small refactoring of initdb call

This commit is contained in:
Alexander Kukushkin
2015-05-18 15:57:24 +02:00
parent ce936ceee2
commit e9ffcf9efe
+3 -6
View File
@@ -79,12 +79,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') == 0:
self.write_pg_hba()
return True
return False
ret = os.system(self._pg_ctl + ' initdb') == 0
ret and self.write_pg_hba()
return ret
def sync_from_leader(self, leader):
r = parseurl(leader.address)