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

RFE: Optionally handle command return code in Actions plugin #2023

Closed
marbu opened this issue Jan 26, 2025 · 1 comment · Fixed by #2068
Closed

RFE: Optionally handle command return code in Actions plugin #2023

marbu opened this issue Jan 26, 2025 · 1 comment · Fixed by #2068
Assignees

Comments

@marbu
Copy link

marbu commented Jan 26, 2025

Description

Actions plugin allows to execute external program for given libdnf5 hooks, but there seems to be no way to propagate an error back when the external program exits with non zero return code.

It would be interesting to have an option (in actions file format) to make dnf5 to raise an error when command returns non zero return code. Right now, the error is ignored.

Reasoning

I was exploring the actions plugin to see if I could implement etckeeper dnf5 integration this way, and it turns out that this error handing functionality is the only missing piece.

See https://bugzilla.redhat.com/show_bug.cgi?id=2326283#c3

Example

It could workd like this: by specifying raise_error=1 dnf5 would stop the transaction.

# cat /etc/dnf/libdnf5-plugins/actions.d/etckeeper.actions
pre_transaction:::raise_error=1:etckeeper pre-install
post_transaction:::raise_error=1:etckeeper post-install
@jrohel jrohel self-assigned this Feb 14, 2025
@jrohel
Copy link
Contributor

jrohel commented Feb 14, 2025

This is a good request.
Successful execution of some plugins (actions) is mandatory for further running of the program. Therefore it is necessary that the action has the possibility to interrupt the program.

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 a pull request may close this issue.

2 participants