Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate exit code from the run() and do_() commandline methods #1533

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

dmach
Copy link
Contributor

@dmach dmach commented Apr 8, 2024

Fixes: #1532

Comment on lines +565 to 568
sys.exit(exit_code)
else:
args = None
return cmd, args
Copy link
Contributor

@marcosbc marcosbc Apr 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to point out that the code inside the if run: block would never reach the return cmd, args statement, not sure if that's expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking. Yes, it is expected. run=False is used during tests to check the command and arguments that would be normally executed.

@dmach dmach force-pushed the cmd-propagate-exit-code branch 9 times, most recently from aaee075 to 7bdb5e7 Compare April 9, 2024 19:32
behave/features/steps/common.py Fixed Show fixed Hide fixed
behave/features/steps/common.py Fixed Show fixed Hide fixed
@dmach dmach force-pushed the cmd-propagate-exit-code branch from e013d9c to 201b302 Compare April 10, 2024 08:17
dmach added 3 commits April 10, 2024 15:04
This was a bad API, command handlers should return None or an exit code.
Anything that returns an actual value belongs to the library instead.
@dmach dmach force-pushed the cmd-propagate-exit-code branch from 201b302 to 2b3e04e Compare April 10, 2024 13:04
@dmach dmach merged commit 56f84ab into openSUSE:master Apr 10, 2024
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed run of "osc service manualrun" does not throw non-zero exit code
2 participants