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"):