From 4002cfbdcd24a5c6a45bc2c1ce0ccfaf634d5e4d Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 27 Aug 2012 21:31:20 -0400 Subject: [PATCH] Minor string tweak. --- lib/ansible/playbook/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/playbook/__init__.py b/lib/ansible/playbook/__init__.py index a5882b68f0..1e1402da0c 100644 --- a/lib/ansible/playbook/__init__.py +++ b/lib/ansible/playbook/__init__.py @@ -166,10 +166,13 @@ class PlayBook(object): # 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. unknown_tags = set(self.only_tags) - (matched_tags_all | unmatched_tags_all) + if len(unknown_tags) > 0: unmatched_tags_all.discard('all') - msg = 'tags "%s" given as argument but not found in playbooks, did you mean one of "%s"?' - raise errors.AnsibleError(msg % (', '.join(unknown_tags),', '.join(unmatched_tags_all))) + msg = 'tag(s) not found in playbook: %s. possible values: %s' + unknown = ','.join(sorted(unknown_tags)) + unmatched = ','.join(sorted(unmatched_tags_all)) + raise errors.AnsibleError(msg % (unknown, unmatched)) for play in plays: self._run_play(play)