mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Initial fix to purge specified files if already removed, but not installed
This commit is contained in:
parent
075d2e1f4c
commit
0cf89f147c
1 changed files with 17 additions and 9 deletions
|
@ -2902,16 +2902,24 @@ def _uninstall(
|
|||
name, version, pkgs, normalize, ignore_epoch=ignore_epoch, **kwargs
|
||||
)
|
||||
if isinstance(targets, dict) and "result" in targets:
|
||||
return targets
|
||||
if action == "purge":
|
||||
# found nothing, reset state return obj to empty list and check for removed to be purged
|
||||
targets = []
|
||||
else:
|
||||
return targets
|
||||
elif not isinstance(targets, list):
|
||||
return {
|
||||
"name": name,
|
||||
"changes": {},
|
||||
"result": False,
|
||||
"comment": "An error was encountered while checking targets: {}".format(
|
||||
targets
|
||||
),
|
||||
}
|
||||
if action == "purge":
|
||||
# found nothing, reset state return obj to empty list and check for removed to be purged
|
||||
targets = []
|
||||
else:
|
||||
return {
|
||||
"name": name,
|
||||
"changes": {},
|
||||
"result": False,
|
||||
"comment": "An error was encountered while checking targets: {}".format(
|
||||
targets
|
||||
),
|
||||
}
|
||||
if action == "purge":
|
||||
old_removed = __salt__["pkg.list_pkgs"](
|
||||
versions_as_list=True, removed=True, **kwargs
|
||||
|
|
Loading…
Add table
Reference in a new issue