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

pull/28274/merge
Andrew Gaffney 6 years ago committed by GitHub
parent cbb6a7f4e8
commit 1cf07028d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save