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

Don't display host pattern warning for empty groups (fixes #35255) (#39927)

This commit is contained in:
Andrew Gaffney 2018-05-09 14:13:48 -05:00 committed by GitHub
parent cbb6a7f4e8
commit 1cf07028d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -544,8 +544,10 @@ class InventoryManager(object):
if implicit:
results.append(implicit)
if not results and pattern != 'all':
# Display warning if specified host pattern did not match any groups or hosts
if not results and not matching_groups and pattern != 'all':
display.warning("Could not match supplied host pattern, ignoring: %s" % pattern)
return results
def list_hosts(self, pattern="all"):