Merge "Sync three-part RPC versions support from Oslo"
This commit is contained in:
commit
bd8ab18b6d
@ -449,10 +449,22 @@ def version_is_compatible(imp_version, version):
|
||||
"""
|
||||
version_parts = version.split('.')
|
||||
imp_version_parts = imp_version.split('.')
|
||||
try:
|
||||
rev = version_parts[2]
|
||||
except IndexError:
|
||||
rev = 0
|
||||
try:
|
||||
imp_rev = imp_version_parts[2]
|
||||
except IndexError:
|
||||
imp_rev = 0
|
||||
|
||||
if int(version_parts[0]) != int(imp_version_parts[0]): # Major
|
||||
return False
|
||||
if int(version_parts[1]) > int(imp_version_parts[1]): # Minor
|
||||
return False
|
||||
if (int(version_parts[1]) == int(imp_version_parts[1]) and
|
||||
int(rev) > int(imp_rev)): # Revision
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user