mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
For ansible --list-hosts benefit apply hosts selection limits early
This commit is contained in:
@@ -70,6 +70,8 @@ class Cli(object):
|
||||
pattern = args[0]
|
||||
|
||||
inventory_manager = inventory.Inventory(options.inventory)
|
||||
if options.subset:
|
||||
inventory_manager.subset(options.subset)
|
||||
hosts = inventory_manager.list_hosts(pattern)
|
||||
if len(hosts) == 0:
|
||||
print >>sys.stderr, "No hosts matched"
|
||||
|
||||
Reference in New Issue
Block a user