Start raising SaltInvocationError

This commit is contained in:
Pedro Algarvio 2015-01-10 12:15:38 +00:00
parent 01ee8613e6
commit f2276afac9

View File

@ -742,17 +742,6 @@ def format_call(fun,
continue
extra[key] = copy.deepcopy(value)
# We'll be showing errors to the users until Salt Lithium comes out, after
# which, errors will be raised instead.
warn_until(
'Lithium',
'It\'s time to start raising `SaltInvocationError` instead of '
'returning warnings',
# Let's not show the deprecation warning on the console, there's no
# need.
_dont_call_warnings=True
)
if extra:
# Found unexpected keyword arguments, raise an error to the user
if len(extra) == 1:
@ -776,20 +765,14 @@ def format_call(fun,
'{0}.{1}'.format(fun.__module__, fun.__name__)
)
)
# Return a warning to the user explaining what's going on
ret.setdefault('warnings', []).append(
raise SaltInvocationError(
'{0}. If you were trying to pass additional data to be used '
'in a template context, please populate \'context\' with '
'\'key: value\' pairs. Your approach will work until Salt Lithium '
'is out.{1}'.format(
'\'key: value\' pairs.{1}'.format(
msg,
'' if 'full' not in ret else ' Please update your state files.'
)
)
# Lets pack the current extra kwargs as template context
ret.setdefault('context', {}).update(extra)
return ret