Merge pull request #5895 from trbs/listtasks_honors_limit

make --list-tasks honor --limit
pull/6479/merge
Michael DeHaan 11 years ago
commit 0dde3b7080

@ -206,12 +206,14 @@ def main(args):
playnum += 1 playnum += 1
play = ansible.playbook.Play(pb, play_ds, play_basedir) play = ansible.playbook.Play(pb, play_ds, play_basedir)
label = play.name label = play.name
if options.listhosts:
hosts = pb.inventory.list_hosts(play.hosts) hosts = pb.inventory.list_hosts(play.hosts)
if options.listhosts:
print ' play #%d (%s): host count=%d' % (playnum, label, len(hosts)) print ' play #%d (%s): host count=%d' % (playnum, label, len(hosts))
for host in hosts: for host in hosts:
print ' %s' % host print ' %s' % host
if options.listtasks: if options.listtasks:
if options.subset and not hosts:
continue
matched_tags, unmatched_tags = play.compare_tags(pb.only_tags) matched_tags, unmatched_tags = play.compare_tags(pb.only_tags)
# Remove skipped tasks # Remove skipped tasks

Loading…
Cancel
Save