Skip to content

Commit 6424451

Browse files
committed
[create_archive_push] archive_push_command in testgres_pg_probackup added
1 parent 70d2f27 commit 6424451

File tree

1 file changed

+14
-0
lines changed
  • testgres/plugins/pg_probackup2/pg_probackup2

1 file changed

+14
-0
lines changed

Diff for: testgres/plugins/pg_probackup2/pg_probackup2/app.py

+14
Original file line numberDiff line numberDiff line change
@@ -748,5 +748,19 @@ def load_backup_class(fs_type):
748748

749749
return getattr(module, class_name)
750750

751+
def archive_push(self, instance, node, wal_file_name, wal_file_path=None, options=None, expect_error=False):
752+
if options is None:
753+
options = []
754+
cmd = [
755+
'archive-push',
756+
'--instance={0}'.format(instance),
757+
'--wal-file-name={0}'.format(wal_file_name),
758+
]
759+
if wal_file_path is None:
760+
cmd = cmd + ['--wal-file-path={0}'.format(os.path.join(node.data_dir, 'pg_wal'))]
761+
else:
762+
cmd = cmd + ['--wal-file-path={0}'.format(wal_file_path)]
763+
return self.run(cmd + options, expect_error=expect_error)
764+
751765
def build_backup_dir(self, backup='backup'):
752766
return fs_backup_class(rel_path=self.rel_path, backup=backup)

0 commit comments

Comments
 (0)