mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Adding support for installing patches in yum/dnf execution module
This commit is contained in:
parent
89fe66af90
commit
ec78ceeb58
@ -1171,9 +1171,14 @@ def install(name=None,
|
|||||||
reinstall = salt.utils.is_true(reinstall)
|
reinstall = salt.utils.is_true(reinstall)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pkg_params, pkg_type = __salt__['pkg_resource.parse_targets'](
|
if "advisory_ids" in kwargs:
|
||||||
name, pkgs, sources, normalize=normalize, **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, normalize=normalize, **kwargs
|
||||||
|
)
|
||||||
except MinionError as exc:
|
except MinionError as exc:
|
||||||
raise CommandExecutionError(exc)
|
raise CommandExecutionError(exc)
|
||||||
|
|
||||||
@ -1418,6 +1423,8 @@ def install(name=None,
|
|||||||
targets = []
|
targets = []
|
||||||
with _temporarily_unhold(to_install, targets):
|
with _temporarily_unhold(to_install, targets):
|
||||||
if targets:
|
if targets:
|
||||||
|
if pkg_type == 'advisory':
|
||||||
|
targets = ["--advisory={0}".format(t) for t in targets]
|
||||||
cmd = []
|
cmd = []
|
||||||
if salt.utils.systemd.has_scope(__context__) \
|
if salt.utils.systemd.has_scope(__context__) \
|
||||||
and __salt__['config.get']('systemd.scope', True):
|
and __salt__['config.get']('systemd.scope', True):
|
||||||
@ -1426,7 +1433,7 @@ def install(name=None,
|
|||||||
if _yum() == 'dnf':
|
if _yum() == 'dnf':
|
||||||
cmd.extend(['--best', '--allowerasing'])
|
cmd.extend(['--best', '--allowerasing'])
|
||||||
_add_common_args(cmd)
|
_add_common_args(cmd)
|
||||||
cmd.append('install')
|
cmd.append('install' if pkg_type is not 'advisory' else 'update')
|
||||||
cmd.extend(targets)
|
cmd.extend(targets)
|
||||||
out = __salt__['cmd.run_all'](
|
out = __salt__['cmd.run_all'](
|
||||||
cmd,
|
cmd,
|
||||||
|
Loading…
Reference in New Issue
Block a user