Bug 1062884
| Summary: | [api] Allow dnf plugin to set exit code | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Miroslav Suchý <msuchy> |
| Component: | dnf | Assignee: | Ales Kozumplik <akozumpl> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | akozumpl, jzeleny, pnemade, rholy |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | dnf-plugins-core-0.0.8-2.fc20 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-05-31 23:58:20 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Miroslav Suchý
2014-02-08 10:51:37 UTC
similar to bug 1062889, needs the signup mechanism. Related: bug 658210, bug 684859. Very chaotic. What we will provide in DNF is a code for exits that core DNF itself considers a success otherwise. If DNF CLI for instance encounters unreadable main config file or similar it will terminate with its own error soon (i.e. 1). Note it's probably not an entirely solid design for a plugin to use the return value to communicate some sort of semi-error to the user. Plugins can raise an exception if they fail which will be propagated to DNF, logged to the terminal and handled as a DNF error (i.e. return code 1 again). Why should be all errors fatals? And raising of exception will mean termination of DNF. I can see those level: 1) warning to stderr 2) warning to stderr with non zero return code 3) fatal error with non zero return code 1 and 3 is currently possible. 2 is not possible. I see use case of 2) when some non fatal error occurred, and human can usually handle it. But automated script should rather process it as error. And status code is much better than parsing stderr of DNF. Right, that's what the fix will allow. Fixed on master by 8830a1c. The plugins can now do e.g. cli.demands.success_exit_status = 29 To set the program exit status for cases where it does not terminate with a fatal error. dnf-0.5.1-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/dnf-0.5.1-1.fc20 Package dnf-0.5.1-1.fc20, hawkey-0.4.14-1.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dnf-0.5.1-1.fc20 hawkey-0.4.14-1.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-5937/hawkey-0.4.14-1.fc20,dnf-0.5.1-1.fc20 then log in and leave karma (feedback). dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/libsolv-0.6.1-1.git6d968f1.fc20,hawkey-0.4.16-1.fc20,dnf-0.5.2-1.fc20,dnf-plugins-core-0.0.8-2.fc20 Package dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dnf-plugins-core-0.0.8-2.fc20 libsolv-0.6.1-1.git6d968f1.fc20 hawkey-0.4.16-1.fc20 dnf-0.5.2-1.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-6789/libsolv-0.6.1-1.git6d968f1.fc20,hawkey-0.4.16-1.fc20,dnf-0.5.2-1.fc20,dnf-plugins-core-0.0.8-2.fc20 then log in and leave karma (feedback). dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. |