mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Refactor code (a bit)
This commit is contained in:
parent
df89da4d15
commit
4caf201052
1 changed files with 5 additions and 5 deletions
|
@ -900,16 +900,16 @@ def _uninstall(name=None, pkgs=None):
|
|||
raise CommandExecutionError(exc)
|
||||
|
||||
old = list_pkgs()
|
||||
targets = [x for x in pkg_params if x in old]
|
||||
targets = [target for target in pkg_params if target in old]
|
||||
if not targets:
|
||||
return {}
|
||||
|
||||
while targets:
|
||||
cmd = _zypper('remove', *targets[:500])
|
||||
__salt__['cmd.run'](cmd, output_loglevel='trace')
|
||||
__salt__['cmd.run'](_zypper('remove', *targets[:500]), output_loglevel='trace')
|
||||
targets = targets[500:]
|
||||
__context__.pop('pkg.list_pkgs', None)
|
||||
new = list_pkgs()
|
||||
return salt.utils.compare_dicts(old, new)
|
||||
|
||||
return salt.utils.compare_dicts(old, list_pkgs())
|
||||
|
||||
|
||||
def remove(name=None, pkgs=None, **kwargs): # pylint: disable=unused-argument
|
||||
|
|
Loading…
Add table
Reference in a new issue