mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
For ansible --list-hosts benefit apply hosts selection limits early
This commit is contained in:
parent
924e9ffe8b
commit
82011b043a
1 changed files with 2 additions and 0 deletions
|
@ -70,6 +70,8 @@ class Cli(object):
|
||||||
pattern = args[0]
|
pattern = args[0]
|
||||||
|
|
||||||
inventory_manager = inventory.Inventory(options.inventory)
|
inventory_manager = inventory.Inventory(options.inventory)
|
||||||
|
if options.subset:
|
||||||
|
inventory_manager.subset(options.subset)
|
||||||
hosts = inventory_manager.list_hosts(pattern)
|
hosts = inventory_manager.list_hosts(pattern)
|
||||||
if len(hosts) == 0:
|
if len(hosts) == 0:
|
||||||
print >>sys.stderr, "No hosts matched"
|
print >>sys.stderr, "No hosts matched"
|
||||||
|
|
Loading…
Reference in a new issue