devexp-db / distgen

Distribution oriented templating system
http://distgen.readthedocs.io/
GNU General Public License v2.0
18 stars 13 forks source link

Exit code 2 for unallowed selectors #130

Closed frenzymadness closed 1 year ago

frenzymadness commented 1 year ago

We need that for example for container images where we run distgen for all combinations of distros/versions and some of those combinations might not be allowed or present in multispec. In this specific case, we want to silence the output from distgen so the log from the generator is not full of errors.

It's hard to tell which exit code is the best one for this. I think that if you have correct definitions in multispec and you request some invalid or unallowed selectors from distgen, it can be considered as misuse of CLI which usually uses exit code 2. But we can use whatever we want so feel free to voice your preference.

There are some other simple fixes I did during the implementation of the main change.

Related: https://github.com/sclorg/s2i-python-container/issues/594

zmiklank commented 1 year ago

Lumir, thanks for the PR.

I agree with using exit code 2. I also see exit code 95 as possible one (Operation not supported).

praiskup commented 1 year ago

Weird, what's up with CI?

praiskup commented 1 year ago

Ok, the worflow was disabled for inactivity. Perhaps #131 helps, dunno. Would you mind rebasing the PR to trigger the test builds?

frenzymadness commented 1 year ago

Rebased, CI is running.

praiskup commented 1 year ago

LGTM

praiskup commented 1 year ago

@zmiklank OK to merge?

zmiklank commented 1 year ago

@zmiklank OK to merge?

Sure :).

zmiklank commented 1 year ago

I will create a new release, so we can start to use this functionality. Thanks Lumir.