Merge pull request #5662 from RSpiertz/update_playbook_error

PlayBook: better error message
This commit is contained in:
jctanner 2014-02-04 11:16:44 -08:00
commit 253fe7be50

View file

@ -95,8 +95,17 @@ class PlayBook(object):
self.SETUP_CACHE = SETUP_CACHE self.SETUP_CACHE = SETUP_CACHE
if playbook is None or callbacks is None or runner_callbacks is None or stats is None: arguments = []
raise Exception('missing required arguments') if playbook is None:
arguments.append('playbook')
if callbacks is None:
arguments.append('callbacks')
if runner_callbacks is None:
arguments.append('runner_callbacks')
if stats is None:
arguments.append('stats')
if arguments:
raise Exception('PlayBook missing required arguments: %s' % ', '.join(arguments))
if extra_vars is None: if extra_vars is None:
extra_vars = {} extra_vars = {}