-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Use StrictVersion class to avoid wrong version comparisons that happen in some cases using LooseVersion class which results in TypeError #10178
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
Conversation
…n in some cases using LooseVersion class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
changelogs/fragments/10178-complete-fix-of-typeerror-cobbler-xmlrpc.yml
Outdated
Show resolved
Hide resolved
…in cobbler system module
changelogs/fragments/10178-complete-fix-of-typeerror-cobbler-xmlrpc.yml
Outdated
Show resolved
Hide resolved
Backport to stable-10: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 9717bac on top of patchback/backports/stable-10/9717bac816fc4d0774405a1ebd32379fddf8e0dc/pr-10178 Backporting merged PR #10178 into stable-10
🤖 @patchback |
@umiruka thanks for fixing this! |
…n in some cases using LooseVersion class which results in TypeError (ansible-collections#10178) * Use StrictVersion class to avoid wrong version comparisons that happen in some cases using LooseVersion class * Refactor code * Add changelog for PR number 10178 * Update changelog to be more precise * Use LooseVersion instead of StrictVersion to check cobbler's version in cobbler system module * Update PR 10178 changelog description to be more accurate
I cherry-picked this into |
…n in some cases using LooseVersion class which results in TypeError (#10178) * Use StrictVersion class to avoid wrong version comparisons that happen in some cases using LooseVersion class * Refactor code * Add changelog for PR number 10178 * Update changelog to be more precise * Use LooseVersion instead of StrictVersion to check cobbler's version in cobbler system module * Update PR 10178 changelog description to be more accurate
I will take note of that for next time. |
SUMMARY
Fixes #8506 and complements PR #10145
ISSUE TYPE
COMPONENT NAME
cobbler_system
pluginADDITIONAL INFORMATION
When running a task with state param set to
present
(default value) as in the following example:I get the following error:
This still happens after the fix #10145 because
LooseVersion
class does not compare the version numbers that are in different formats as expected. Cobbler's xmlrpc client library returns the version number for version3.4.0
as3.4
so as a result the comparison in line gives the following:The expected result of the above comparison is
True
.When using
StrictVersion
class we get the expected result:Cobbler version
Ansible version
community.general