Skip to content

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

@marbu

Description

@marbu

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions