Skip to content

Commit 1592518

Browse files
committed
Use semicolon separator for pgBackRest error messages
Concatenate multiple ERROR/WARN lines with "; " instead of " " for improved readability when debugging backup issues. Updated unit test to match new separator format. Cherry-picked from #1328 (commit 1f1b601). Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
1 parent 9813b49 commit 1592518

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def _extract_error_message(stdout: str, stderr: str) -> str:
383383

384384
# If we found error/warning lines, return them joined
385385
if error_lines:
386-
return " ".join(error_lines)
386+
return "; ".join(error_lines)
387387

388388
# Otherwise return the last non-empty line from stderr or stdout
389389
if stderr.strip():

tests/unit/test_backups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_extract_error_message_with_multiple_errors():
7777
P00 ERROR: second error"""
7878
stderr = ""
7979
result = PostgreSQLBackups._extract_error_message(stdout, stderr)
80-
assert result == "ERROR: first error WARN: warning message ERROR: second error"
80+
assert result == "ERROR: first error; WARN: warning message; ERROR: second error"
8181

8282

8383
def test_extract_error_message_with_empty_output():

0 commit comments

Comments
 (0)