Multiple small fixes:

- Do delete trigger file in the patroni itself.
- Fix the typo in the datadir member.
- Add #! at the top of the python script.
This commit is contained in:
Oleksii Kliukin
2015-08-03 15:51:40 +02:00
parent 2089a123c2
commit fd884a53a9
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -154,6 +154,7 @@ class Postgresql:
cmd = self.config['restore']
ret = subprocess.call(shlex.split(os.path.abspath(cmd))+[self.scope, "replica",
self.data_dir, connstring], env=env)
self.delete_trigger_file()
return ret
def is_leader(self, check_only=False):
Regular → Executable
+2 -2
View File
@@ -1,3 +1,4 @@
#!/usr/bin/python
# arguments are:
# - cluster scope
# - cluster role
@@ -17,7 +18,7 @@ class Restore:
self.scope = scope
self.role = role
self.connstring = connstring
self.datadir = datadir
self.data_dir = datadir
self.env = os.environ.copy()
def parse_connstring(self):
@@ -50,7 +51,6 @@ class Restore:
ret = subprocess.call(['pg_basebackup', '-R', '-D', self.data_dir, '--host=' + master_connection['host'],
'--port=' + str(master_connection['port']), '-U', master_connection['user']],
env=self.env)
self.delete_trigger_file()
return ret