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

adjusted list hosts across adhoc and playbook cli

This commit is contained in:
Brian Coca 2015-07-29 14:56:22 -04:00 committed by James Cammarata
parent 3a50c08c01
commit ced93d35ca
2 changed files with 2 additions and 1 deletions

View file

@ -111,6 +111,7 @@ class AdHocCLI(CLI):
self.display.warning("provided hosts list is empty, only localhost is available") self.display.warning("provided hosts list is empty, only localhost is available")
if self.options.listhosts: if self.options.listhosts:
self.display.display(' hosts (%d):' % len(hosts))
for host in hosts: for host in hosts:
self.display.display(' %s' % host) self.display.display(' %s' % host)
return 0 return 0

View file

@ -166,7 +166,7 @@ class PlaybookCLI(CLI):
if self.options.listhosts: if self.options.listhosts:
playhosts = set(inventory.get_hosts(play.hosts)) playhosts = set(inventory.get_hosts(play.hosts))
msg += "\n pattern: %s\n total hosts: %d\n hosts:" % (play.hosts, len(playhosts)) msg += "\n pattern: %s\n hosts (%d):" % (play.hosts, len(playhosts))
for host in playhosts: for host in playhosts:
msg += "\n %s" % host msg += "\n %s" % host