8000 Don't arbitrarily fail BaseTaskNamespace.parse_ipa_version(), do it explicitly by hroncok · Pull Request #7797 · freeipa/freeipa · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Don't arbitrarily fail BaseTaskNamespace.parse_ipa_version(), do it explicitly #7797

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hroncok
Copy link
Contributor
@hroncok hroncok commented May 6, 2025

Classes inheriting from BaseTaskNamespace
always need to implement their own parse_ipa_version method, because otherwise they would get instances of IPAAbstractVersion which is not comparable.

Even if that was not the problem,
passing packaging.version.Version objects to IPAAbstractVersion leads to AttributeError in init when trying to call .encode() on them.

Summary by Sourcery

Modify BaseTaskNamespace to require explicit implementation of parse_ipa_version method

Bug Fixes:

  • Prevent potential AttributeError when parsing versions
  • Remove default implementation that could lead to incorrect version comparisons

Enhancements:

  • Enforce explicit implementation of parse_ipa_version in subclasses

…xplicitly

Classes inheriting from BaseTaskNamespace
always need to implement their own parse_ipa_version method,
because otherwise they would get instances of IPAAbstractVersion which is not comparable.

Even if that was not the problem,
passing packaging.version.Version objects to IPAAbstractVersion
leads to AttributeError in __init__ when trying to call .encode() on them.
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 this pull request may close these issues.

1 participant
0