2b8750d Issue #50712 - Version comparison doesn't work correctly on git builds

Authored and Committed by vashirov 4 years ago
    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!)
    
        
file modified
+2 -2