versionutils.is_compatible calling unnecessary tuple conversion

Bug #1641932 reported by chenyujie on 2016-11-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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'.

chenyujie (gzyjchen) wrote :
ChangBo Guo(gcb) (glongwave) wrote :

This is duplicated with and fixed

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

Other bug subscribers