Adding support for installing patches in Zypper module

This commit is contained in:
Pablo Suárez Hernández 2017-03-21 11:10:23 +00:00
parent ec78ceeb58
commit 2612efc688

View File

@ -992,6 +992,11 @@ def install(name=None,
refresh_db()
try:
if 'advisory_ids' in kwargs:
if pkgs:
raise SaltInvocationError('Cannot use "advisory_ids" and "pkgs" at the same time')
pkg_params, pkg_type = kwargs['advisory_ids'], 'advisory'
else:
pkg_params, pkg_type = __salt__['pkg_resource.parse_targets'](name, pkgs, sources, **kwargs)
except MinionError as exc:
raise CommandExecutionError(exc)
@ -1047,6 +1052,8 @@ def install(name=None,
cmd_install.extend(fromrepoopt)
errors = []
if pkg_type == 'advisory':
targets = ["patch:{0}".format(t) for t in targets]
# Split the targets into batches of 500 packages each, so that
# the maximal length of the command line is not broken