mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix condition from returning None on 0
This commit is contained in:
parent
0a68ebff16
commit
3706a21c29
1 changed files with 2 additions and 2 deletions
|
@ -587,8 +587,8 @@ def version_cmp(ver1, ver2):
|
|||
cmp_func = rpmUtils.miscutils.compareEVR
|
||||
else:
|
||||
cmp_func = None
|
||||
cmp_result = cmp_func is not None and cmp_func(salt.utils.str_version_to_evr(ver1),
|
||||
salt.utils.str_version_to_evr(ver2)) or None
|
||||
cmp_result = cmp_func is None and 2 or cmp_func(salt.utils.str_version_to_evr(ver1),
|
||||
salt.utils.str_version_to_evr(ver2))
|
||||
if cmp_result not in (-1, 0, 1):
|
||||
raise Exception("Comparison result '{0}' is invalid".format(cmp_result))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue