mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
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:
@@ -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
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user