This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
commit 06096b3e8459b20b2814d064d8478159673c613d
Author: Viktor Ashirov <vashirov(a)redhat.com>
AuthorDate: Tue Nov 12 17:55:21 2019 +0100
Issue #50712 - Version comparison doesn't work correctly on git builds
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: tbordaz (Thanks!)
---
src/lib389/lib389/utils.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/lib389/lib389/utils.py b/src/lib389/lib389/utils.py
index a0b063a..668501a 100644
--- a/src/lib389/lib389/utils.py
+++ b/src/lib389/lib389/utils.py
@@ -1079,7 +1079,11 @@ def ds_is_related(relation, *ver):
if cmp_ver.startswith(ds_ver[:3]):
return ops[relation](ds_ver,cmp_ver)
else:
+<<<<<<< HEAD
return ops[relation](ds_ver, ver[0])
+=======
+ return ops[relation](LegacyVersion(ds_ver), LegacyVersion(ver[0]))
+>>>>>>> 2b8750d6b... Issue #50712 - Version comparison doesn't
work correctly on git builds
def ds_is_older(*ver):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.