Skip to content

Commit

Permalink
Don't print the error message on multispec exit code 2
Browse files Browse the repository at this point in the history
For non-existing and not expected matrix combinations generator
produced a loud message that looked like a genuine error.

```
[ERROR] distgen failed: Command '['dg', '--multispec', 'specs/multispec.yml',
'--template', 'src/Dockerfile.template', '--distro', 'centos-7-x86_64.yaml',
'--multispec-selector', 'version=3.11', '--output', '3.11/Dockerfile.centos7']'
returned non-zero exit status 2.
```

For exit code 2 the message is now supressed.
Related: sclorg/s2i-python-container#594
  • Loading branch information
befeleme authored and zmiklank committed Jun 23, 2023
1 parent e746a70 commit 6f1b33a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def run_distgen(
try:
check_output(cmd)
except CalledProcessError as e:
print("[ERROR] distgen failed:", e)
# Exit code 2 is a special code for non existing matrix combinations
# It's not an actual error, hence don't print out its error message
if e.returncode != 2:
print("[ERROR] distgen failed:", e)


def get_version_distro_mapping(
Expand Down

0 comments on commit 6f1b33a

Please sign in to comment.