Commit 5a4f39bf by Michael DeHaan

Make "No hosts matched" go to stderr.

parent f88bf574
...@@ -94,7 +94,7 @@ class Cli(object): ...@@ -94,7 +94,7 @@ class Cli(object):
inventory_manager.subset(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:
callbacks.display("No hosts matched") callbacks.display("No hosts matched", stderr=True)
sys.exit(0) sys.exit(0)
if options.listhosts: if options.listhosts:
...@@ -141,7 +141,7 @@ class Cli(object): ...@@ -141,7 +141,7 @@ class Cli(object):
inventory_manager.subset(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:
callbacks.display("No hosts matched") callbacks.display("No hosts matched", stderr=True)
sys.exit(0) sys.exit(0)
if options.listhosts: if options.listhosts:
......
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