Bug 1248154 - [rfe] subscription-manager plugins should raise the correct exceptions for the environment it is operating in.
[rfe] subscription-manager plugins should raise the correct exceptions for th...
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager (Show other bugs)
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: candlepin-bugs
John Sefler
: FutureFeature, Triaged
Depends On:
  Show dependency treegraph
Reported: 2015-07-29 14:00 EDT by Adrian Likins
Modified: 2017-07-01 19:53 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Adrian Likins 2015-07-29 14:00:12 EDT
Description of problem:

src/subscription_manager/plugins.py's run() methods currently catch any
exceptions from within the plugin code, log it, and then reraise it.

Since the subman code is embedded within yum, initial-setup, anaconda and other tools, it should not raise unexpected exceptions into those apps.

1) Catch and log them, then drop them.
2) Catch and log them, but instead of raising the origin exception again, raise a subscription-manager plugin api specific Exception, that could be more easily handled by plugins for other apps (plugins/productid.py for ex).
Comment 2 John Sefler 2015-09-25 12:19:14 EDT
deferring to rhel-7.3.0 due to schedule and severity
Comment 4 Barnaby Court 2016-02-23 13:31:17 EST
For dnf Documentation on exceptions & logging can be found at http://dnf.readthedocs.org/en/latest/api_common.html & http://dnf.readthedocs.org/en/latest/api_exceptions.html

For yum, if a fatal exception occurs then a PluginYumExit() exception should be raised.  Yum warnings are done either via. the plugin API conduit.info() etc. … or by just getting the yum base object and using base.logger etc.

Note You need to log in before you can comment on or make changes to this bug.