From e9ffcf9efe378cd514853364b3b525ecaec7c181 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Mon, 18 May 2015 15:57:24 +0200 Subject: [PATCH] Small refactoring of initdb call --- helpers/postgresql.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/helpers/postgresql.py b/helpers/postgresql.py index 7b8a15c8..732e86aa 100644 --- a/helpers/postgresql.py +++ b/helpers/postgresql.py @@ -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)