mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
force arguments to apt_pkg.version_compare into strings
very commonly a float will be passed to the function due to the way module execution and yaml parsing works. this will throw a TypeError, which will cause the function to move on to the shell fallback.
This commit is contained in:
parent
d02f388b08
commit
d56efd1341
1 changed files with 4 additions and 0 deletions
|
@ -1123,6 +1123,10 @@ def version_cmp(pkg1, pkg2):
|
|||
|
||||
salt '*' pkg.version_cmp '0.2.4-0ubuntu1' '0.2.4.1-0ubuntu1'
|
||||
'''
|
||||
# both apt_pkg.version_compare and _cmd_quote need string arguments.
|
||||
pkg1 = str(pkg1)
|
||||
pkg2 = str(pkg2)
|
||||
|
||||
# if we have apt_pkg, this will be quickier this way
|
||||
# and also do not rely on shell.
|
||||
if HAS_APTPKG:
|
||||
|
|
Loading…
Add table
Reference in a new issue