1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #4817 from j2sol/zero-exit

Exit 0 with no matched hosts
This commit is contained in:
jctanner 2013-12-02 10:04:18 -08:00
commit 6d80c50faf

View file

@ -81,8 +81,8 @@ class Cli(object):
inventory_manager.subset(options.subset)
hosts = inventory_manager.list_hosts(pattern)
if len(hosts) == 0:
callbacks.display("No hosts matched", stderr=True)
sys.exit(1)
callbacks.display("No hosts matched")
sys.exit(0)
if options.listhosts:
for host in hosts: