Skip to content

Commit

Permalink
chore: fix schema tool source layout check return code handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaakola-aiven committed Oct 16, 2024
1 parent 458b1a6 commit a1a5f39
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/karapace/backup/backends/v3/schema_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,10 @@ def relative_path(path: pathlib.Path) -> pathlib.Path:


def target_has_source_layout(git_target: str) -> bool:
with subprocess.Popen(
["git", "show", f"{git_target}:src"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
) as cp:
if cp.returncode == 128:
return False
return True
cp = subprocess.run(["git", "show", f"{git_target}:src"], capture_output=True, check=False)
if cp.returncode == 128:
return False
return True


def check_compatibility(git_target: str) -> None:
Expand Down

0 comments on commit a1a5f39

Please sign in to comment.