Skip to content

Commit

Permalink
apt: don't markmanual if apt-mark is not installed (ansible#40600)
Browse files Browse the repository at this point in the history
* apt: don't markmanual if apt-mark is not installed

* Add warning
  • Loading branch information
mkrizek authored May 23, 2018
1 parent 8b317e7 commit a3cfe0d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/ansible/modules/packaging/os/apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,13 @@ def mark_installed_manually(m, packages):
if not packages:
return

apt_mark_cmd_path = m.get_bin_path("apt-mark", required=True)
apt_mark_cmd_path = m.get_bin_path("apt-mark")

# https://github.com/ansible/ansible/issues/40531
if apt_mark_cmd_path is None:
m.warn("Could not find apt-mark binary, not marking package(s) as manually installed.")
return

cmd = "%s manual %s" % (apt_mark_cmd_path, ' '.join(packages))
rc, out, err = m.run_command(cmd)

Expand Down

0 comments on commit a3cfe0d

Please sign in to comment.