Project

Profile

Help

Refactor #1407

closed

InvalidChecksumType and VerificationException Exceptions should be replaced with PLP1005 and PLP1013 respectively

Added by bmbouter over 8 years ago. Updated almost 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

The InvalidChecksumType is defined here[0], but instead a PLP1005[1] PulpCodedException should be raised as is done here[2]. VerificationException is defined here[3], but instead a PLP1013[4] PulpCodedException should be raised. Current PLP1013 is not used anywhere.

Both InvalidChecksumType and VerificationException inherit from ValueError. Many plugins have try/except blocks which catch ValueError. In the case of verify_checksum[5] both exception types can be raised and are caught in plugins as a ValueError. As these types are converted the plugin behaviors need to be preserved to catch the appropriate exception and handle it similarly to how it did before. Both objects being inherited from ValueError is motivation to handle these both as a single refactor.

I couldn't find any documentation indicating that these platform capabilities should be used by plugins so semver allows us make this change. I think a Y release would be appropriate.

The benefit of fixing this is that pulp-admin and API results will cleanly display the problem to the user instead of providing some vague "something went wrong" style meeting.

[0]: https://github.com/pulp/pulp/blob/82ccd90ad581def838986b421bd0846d80aa2198/server/pulp/plugins/util/verification.py#L31-L35
[1]: https://github.com/pulp/pulp/blob/82ccd90ad581def838986b421bd0846d80aa2198/common/pulp/common/error_codes.py#L137
[2]: https://github.com/pulp/pulp/blob/82ccd90ad581def838986b421bd0846d80aa2198/server/pulp/plugins/util/verification.py#L71
[3]: https://github.com/pulp/pulp/blob/82ccd90ad581def838986b421bd0846d80aa2198/server/pulp/plugins/util/verification.py#L38-L42
[4]: https://github.com/pulp/pulp/blob/82ccd90ad581def838986b421bd0846d80aa2198/common/pulp/common/error_codes.py#L151
[5]: https://github.com/pulp/pulp/blob/82ccd90ad581def838986b421bd0846d80aa2198/server/pulp/plugins/util/verification.py#L95

Actions #1

Updated by bmbouter over 8 years ago

  • Subject changed from InvalidChecksumType and VerificationException Exceptions should be replaced with PLP1005 and PLP1013 respectivly to InvalidChecksumType and VerificationException Exceptions should be replaced with PLP1005 and PLP1013 respectively
Actions #2

Updated by sbhawsin about 8 years ago

  • Assignee set to sbhawsin
Actions #3

Updated by bmbouter almost 5 years ago

  • Status changed from NEW to CLOSED - WONTFIX
Actions #4

Updated by bmbouter almost 5 years ago

Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.

Actions #5

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF