1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fail apt package install when nothing is matched by the fnmatch pattern

Related to PR #3823
This commit is contained in:
James Cammarata 2013-08-12 11:26:31 -05:00
parent 5c39c659e5
commit 6feb4e3837

View file

@ -185,6 +185,10 @@ def expand_pkgspec_from_fnmatches(m, pkgspec, cache):
else:
matches = fnmatch.filter(
[pkg.name for pkg in cache], pkgname_or_fnmatch_pattern)
if len(matches) == 0:
m.fail_json(msg="No package(s) matching '%s' available" % str(pkgname_or_fnmatch_pattern))
else:
new_pkgspec.extend(matches)
else:
new_pkgspec.append(pkgname_or_fnmatch_pattern)