Warn cleanly if outputter not available

This commit is contained in:
Mike Place 2014-11-22 13:11:09 -07:00
parent 7351cb31a6
commit 2fd8852ab0

View File

@ -52,7 +52,11 @@ def update_progress(opts, progress, progress_iter, out):
Update the progress iterator for the given outputter
'''
# Look up the outputter
progress_outputter = salt.loader.outputters(opts)[out]
try:
progress_outputter = salt.loader.outputters(opts)[out]
except KeyError: # Outputter is not loaded
log.warning('Progress outputter not available.')
return False
progress_outputter(progress, progress_iter)