Skip to content

Commit

Permalink
Potential fix Zypperpkg does not use the version parameter #658
Browse files Browse the repository at this point in the history
  • Loading branch information
winddss committed Jul 10, 2024
1 parent e24c5db commit 705d978
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions salt/modules/zypperpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2063,13 +2063,13 @@ def upgrade(
return ret


def _uninstall(inclusion_detection, name=None, pkgs=None, root=None):
def _uninstall(inclusion_detection, name=None, pkgs=None, version=None, root=None):
"""
Remove and purge do identical things but with different Zypper commands,
this function performs the common logic.
"""
try:
pkg_params = __salt__["pkg_resource.parse_targets"](name, pkgs)[0]
pkg_params = __salt__["pkg_resource.parse_targets"](name, pkgs, version=version)[0]
except MinionError as exc:
raise CommandExecutionError(exc)

Expand Down Expand Up @@ -2147,7 +2147,7 @@ def normalize_name(name):


def remove(
name=None, pkgs=None, root=None, inclusion_detection=False, **kwargs
name=None, pkgs=None, version=None, root=None, inclusion_detection=False, **kwargs
): # pylint: disable=unused-argument
"""
.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
Expand Down Expand Up @@ -2200,7 +2200,7 @@ def remove(
Can now remove also PTF packages which require a different handling in the backend.
"""
return _uninstall(inclusion_detection, name=name, pkgs=pkgs, root=root)
return _uninstall(inclusion_detection, name=name, pkgs=pkgs, version=version, root=root)


def purge(
Expand Down
2 changes: 1 addition & 1 deletion salt/states/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2891,7 +2891,7 @@ def _uninstall(

try:
pkg_params = __salt__["pkg_resource.parse_targets"](
name, pkgs, normalize=normalize
name, pkgs, normalize=normalize, version=version
)[0]
except MinionError as exc:
return {
Expand Down

0 comments on commit 705d978

Please sign in to comment.