versionutils.is_compatible calling unnecessary tuple conversion

Bug #1641932 reported by chenyujie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.utils
Fix Released
Undecided
Unassigned

Bug Description

Code abstract as following:

def is_compatible(requested_version, current_version, same_major=True):
...
    if same_major and (requested_parts[0] != current_parts[0]):
        return False

    return current_parts >= requested_parts
...

'requested_parts' can be compared with 'current_parts' without using tuple reference, such as:

    if same_major and (requested_parts != current_parts):
        return False

Otherwise it would cause a warning from 'pkg_resources'.

Revision history for this message
chenyujie (gzyjchen) wrote :
Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :

This is duplicated with https://bugs.launchpad.net/oslo.utils/+bug/1706394 and fixed

Changed in oslo.utils:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.