Commit 43c9a665 by Daniel Hokka Zakrisson

Merge pull request #2001 from stoned/ansible-limit-list-hosts

For ansible --list-hosts benefit apply hosts selection limits early
parents ded3b954 82011b04
...@@ -70,6 +70,8 @@ class Cli(object): ...@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment