diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py index f5d2606a95..b14c99b265 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py @@ -992,7 +992,12 @@ def install(name=None, refresh_db() try: - pkg_params, pkg_type = __salt__['pkg_resource.parse_targets'](name, pkgs, sources, **kwargs) + 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