#50713 Issue #50712 - Version comparison doesn't work correctly on git builds
Closed by spichugi. Opened by vashirov.
vashirov/389-ds-base ds50712  into  master

Download 50713.patch

Bug Description:

>>> get_ds_version()
'1.4.2.3.20191112git7a7bc7872'
>>> ds_is_older('1.4.0')
True

This happens because packaging.version returns a different object for
'1.4.2.3.20191112git7a7bc7872' (LegacyVersion) than for '1.4.0'
(Version).

And during comparison Version is always higher:

>>> x = Version('1.0')
>>> y = LegacyVersion('2.0')
>>> x > y
True

Fix Description:
Always use LegacyVersion during comparison

Fixes: https://pagure.io/389-ds-base/issue/50712

Reviewed by: ???

It works for me. ACK

rebased onto 2b8750d6b3f8a71679382a2c9dc487811d3cc0e3

Pull-Request has been merged by vashirov

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3768

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata