mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Fix incorrect version argument will be ignored warning
This commit is contained in:
parent
3bc6e3a01d
commit
378b1061e8
3 changed files with 5 additions and 3 deletions
1
changelog/64563.fixed.md
Normal file
1
changelog/64563.fixed.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fixed incorrect version argument will be ignored for multiple package targets warning when using pkgs argument to yumpkg module.
|
|
@ -1424,8 +1424,8 @@ def install(
|
||||||
'version': '<new-version>',
|
'version': '<new-version>',
|
||||||
'arch': '<new-arch>'}}}
|
'arch': '<new-arch>'}}}
|
||||||
"""
|
"""
|
||||||
if "version" in kwargs:
|
if (version := kwargs.get("version")) is not None:
|
||||||
kwargs["version"] = str(kwargs["version"])
|
kwargs["version"] = str(version)
|
||||||
options = _get_options(**kwargs)
|
options = _get_options(**kwargs)
|
||||||
|
|
||||||
if salt.utils.data.is_true(refresh):
|
if salt.utils.data.is_true(refresh):
|
||||||
|
|
|
@ -238,7 +238,7 @@ def test_pkg_002_installed_with_version(PKG_TARGETS, states, latest_version):
|
||||||
|
|
||||||
@pytest.mark.requires_salt_states("pkg.installed", "pkg.removed")
|
@pytest.mark.requires_salt_states("pkg.installed", "pkg.removed")
|
||||||
@pytest.mark.slow_test
|
@pytest.mark.slow_test
|
||||||
def test_pkg_003_installed_multipkg(PKG_TARGETS, modules, states):
|
def test_pkg_003_installed_multipkg(caplog, PKG_TARGETS, modules, states):
|
||||||
"""
|
"""
|
||||||
This is a destructive test as it installs and then removes two packages
|
This is a destructive test as it installs and then removes two packages
|
||||||
"""
|
"""
|
||||||
|
@ -254,6 +254,7 @@ def test_pkg_003_installed_multipkg(PKG_TARGETS, modules, states):
|
||||||
try:
|
try:
|
||||||
ret = states.pkg.installed(name=None, pkgs=PKG_TARGETS, refresh=False)
|
ret = states.pkg.installed(name=None, pkgs=PKG_TARGETS, refresh=False)
|
||||||
assert ret.result is True
|
assert ret.result is True
|
||||||
|
assert "WARNING" not in caplog.text
|
||||||
finally:
|
finally:
|
||||||
ret = states.pkg.removed(name=None, pkgs=PKG_TARGETS)
|
ret = states.pkg.removed(name=None, pkgs=PKG_TARGETS)
|
||||||
assert ret.result is True
|
assert ret.result is True
|
||||||
|
|
Loading…
Add table
Reference in a new issue