Skip to content

Commit 6f1b33a

Browse files
befelemezmiklank
authored andcommitted
Don't print the error message on multispec exit code 2
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
1 parent e746a70 commit 6f1b33a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

generator.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ def run_distgen(
3737
try:
3838
check_output(cmd)
3939
except CalledProcessError as e:
40-
print("[ERROR] distgen failed:", e)
40+
# Exit code 2 is a special code for non existing matrix combinations
41+
# It's not an actual error, hence don't print out its error message
42+
if e.returncode != 2:
43+
print("[ERROR] distgen failed:", e)
4144

4245

4346
def get_version_distro_mapping(

0 commit comments

Comments
 (0)