mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Minor string tweak.
This commit is contained in:
parent
2755602dcb
commit
4002cfbdcd
1 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue