Commit 8e37a2be by martin f. krafft

Fix purging of packages

A small error in the reuse of a variable caused packages to never get
purged. This commit fixes that.

Signed-off-by: martin f. krafft <madduck@madduck.net>
parent fc2d25eb
...@@ -210,9 +210,10 @@ def remove(m, pkgspec, cache, purge=False): ...@@ -210,9 +210,10 @@ def remove(m, pkgspec, cache, purge=False):
if len(packages) == 0: if len(packages) == 0:
m.exit_json(changed=False) m.exit_json(changed=False)
else: else:
purge = ''
if purge: if purge:
purge = '--purge' purge = '--purge'
else:
purge = ''
cmd = "%s -q -y %s remove %s" % (APT_GET_CMD, purge,packages) cmd = "%s -q -y %s remove %s" % (APT_GET_CMD, purge,packages)
if m.check_mode: if m.check_mode:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment