Minor string tweak.

pull/949/merge
Michael DeHaan 12 years ago
parent 2755602dcb
commit 4002cfbdcd

@ -166,10 +166,13 @@ class PlayBook(object):
# if the playbook is invoked with --tags that don't exist at all in the playbooks # if the playbook is invoked with --tags that don't exist at all in the playbooks
# then we need to raise an error so that the user can correct the arguments. # then we need to raise an error so that the user can correct the arguments.
unknown_tags = set(self.only_tags) - (matched_tags_all | unmatched_tags_all) unknown_tags = set(self.only_tags) - (matched_tags_all | unmatched_tags_all)
if len(unknown_tags) > 0: if len(unknown_tags) > 0:
unmatched_tags_all.discard('all') unmatched_tags_all.discard('all')
msg = 'tags "%s" given as argument but not found in playbooks, did you mean one of "%s"?' msg = 'tag(s) not found in playbook: %s. possible values: %s'
raise errors.AnsibleError(msg % (', '.join(unknown_tags),', '.join(unmatched_tags_all))) unknown = ','.join(sorted(unknown_tags))
unmatched = ','.join(sorted(unmatched_tags_all))
raise errors.AnsibleError(msg % (unknown, unmatched))
for play in plays: for play in plays:
self._run_play(play) self._run_play(play)

Loading…
Cancel
Save