Commit 6d80c50f by jctanner

Merge pull request #4817 from j2sol/zero-exit

Exit 0 with no matched hosts
parents c0508724 46554bbc
......@@ -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:
......
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