Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add parsing backup_id in run app.py#126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
demonolock merged 1 commit intomasterfromadd-parse-backup-id
May 30, 2024
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletionstestgres/plugins/pg_probackup2/pg_probackup2/app.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -119,10 +119,7 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
env=env
).decode('utf-8', errors='replace')
if command[0] == 'backup' and return_id:
# return backup ID
for line in self.test_class.output.splitlines():
if 'INFO: Backup' and 'completed' in line:
result = line.split()[2]
result = self.get_backup_id()
else:
result = self.test_class.output
if expect_error is True:
Expand All@@ -139,6 +136,19 @@ def run(self, command, gdb=False, old_binary=False, return_id=True, env=None,
else:
raise ProbackupException(self.test_class.output, self.test_class.cmd)

def get_backup_id(self):
if init_params.major_version > 2:
pattern = re.compile(r"Backup (.*) completed successfully.")
for line in self.test_class.output.splitlines():
match = pattern.search(line)
if match:
return match.group(1)
else:
for line in self.test_class.output.splitlines():
if 'INFO: Backup' and 'completed' in line:
return line.split()[2]
return None

def init(self, options=None, old_binary=False, skip_log_directory=False, expect_error=False, use_backup_dir=True):
if options is None:
options = []
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp